Read data from an excel sheet and print the output

I am working on an arduino project which senses gases like methane, propane, etc using a MQ2 Gas sensor. Analog output is a voltage value which can be related to the change in the sensor resistance and then finding out the concentration of the gas based on the data. But the real problem here is the relation between the sensor resistance and the gas concentration is non-linear in nature and there is lot of data which changes with temperature and RH. (Please find the attached graph showing the relation between resistance and gas concentration for different gases and at different temperatures and RH values. )

Objective of my project is to get the gas concentration as an output. I can find the data and can save the data in an excel sheet. Does arduino has the capabilities to search for the resistance value in the data provided in excel sheet and print the corresponding gas concentration? Please help me. Suggest if there are any alternatives and any useful links.

Thanks for the help.

as far as I can see you have 8 lines of 10 points in the graph.

put those in an array

struct 
{
  int x;
  int y;
} LUT[8][10];

LUT= look up table

suppose you want to use line 3 and you have an x value of 7.38

Then search the two point LUT[3][ a ] and LUT[3] [ a + 1 ] and interpolate between them

As the graph is double log you might want to use a quadratic interpolation (3 points to interpolate) iso linear.
starting with linear might be good to get things started.

Thanks Rob.

Rob,

I tried to work on your suggestions. But I am struck with the syntax issues. Can't find a better solution in forums. Looked into couple of other forums where you suggested to use multiMap function. But IDE gives me some errors. I will explain in this thread my problems, please help me on this.

Trail #1: Using LUT

If i have two arrays as shown below;

int out[]= {1,10,100,1000};
int in[] ={2,3,4,5};

What is the syntax of LUT to get an output, if i need a corresponding value of "in"array element (4) as "out" array element as 100;

Trail #2: multiMap();
IDE gives me this error. see the attached image

Do i need to add any libraries or sth for multimap function to work?

P.S: In case, if something is stupid, bear with me. Just getting started.

Capture.JPG