11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

232<br />

Part II: Using Functions in Your <strong>Formula</strong>s<br />

Figure 8-17: Column B contains formulas that perform a lookup using linear interpolation.<br />

It’s critical that the values in the x range appear in ascending order. If B1 contains a value less<br />

than the lowest value in x or greater than the largest value in x, the formula returns an error<br />

value. Table 8-2 lists and describes these formulas.<br />

Table 8-2: <strong>Formula</strong>s for a Lookup Using Linear Interpolation<br />

Cell <strong>Formula</strong> Description<br />

B3 =LOOKUP(B1,x,x) Performs a standard lookup on the x range and returns the lookedup<br />

value.<br />

B4 =B1=B3 Returns TRUE if the looked-up value equals the value to be looked up.<br />

B6 =MATCH(B3,x,0) Returns the row number of the x range that contains the matching<br />

value.<br />

B7 =IF(B4,B6,B6+1) Returns the same row as the formula in B6 if an exact match is<br />

found. Otherwise, it adds 1 to the result in B6.<br />

B9 =INDEX(x,B6) Returns the x value that corresponds to the row in B6.<br />

B10 =INDEX(x,B7) Returns the x value that corresponds to the row in B7.<br />

B12 =LOOKUP(B9,x,y) Returns the y value that corresponds to the x value in B9.<br />

B13 =LOOKUP(B10,x,y) Returns the y value that corresponds to the x value in B10.<br />

B15 =IF(B4,0,(B1-B3)/(B10-B9)) Calculates an adjustment factor based on the difference between<br />

the x values.<br />

B16 =B12+((B13-B12)*B15) Calculates the estimated y value using the adjustment factor in B15.<br />

Combining the lookup and trend functions<br />

Another slightly different approach, which you may find preferable to performing lookup using<br />

linear interpolation, uses the LOOKUP and TREND functions. One advantage is that it requires<br />

only one formula (see Figure 8-18).

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

Saved successfully!

Ooh no, something went wrong!