11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8: Using Lookup Functions 231<br />

Figure 8-16: This workbook demonstrates a table lookup using linear interpolation.<br />

The worksheet also contains a chart that depicts the relationship between the x range and the y<br />

range graphically. As you can see, there is an approximate linear relationship between the corresponding<br />

values in the x and y ranges: As x increases, so does y. Notice that the values in the x<br />

range are not strictly consecutive. For example, the x range doesn’t contain the following values:<br />

3, 6, 7, 14, 17, 18, and 19.<br />

You can create a lookup formula that looks up a value in the x range and returns the corresponding<br />

value from the y range. But what if you want to estimate the y value for a missing x value? A<br />

normal lookup formula does not return a very good result because it simply returns an existing y<br />

value (not an estimated y value). For example, the following formula looks up the value 3 and<br />

returns 18.00 (the value that corresponds to 2 in the x range):<br />

=LOOKUP(3,x,y)<br />

In such a case, you probably want to interpolate. In other words, because the lookup value (3) is<br />

halfway between existing x values (2 and 4), you want the formula to return a y value of 21.00 —<br />

a value halfway between the corresponding y values 18.00 and 24.00.<br />

<strong>Formula</strong>s to perform a linear interpolation<br />

Figure 8-17 shows a worksheet with formulas in column B. The value to be looked up is entered<br />

into cell B1. The final formula, in cell B16, returns the result. If the value in B3 is found in the x<br />

range, the corresponding y value is returned. If the value in B3 is not found, the formula in B16<br />

returns an estimated y value, obtained using linear interpolation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!