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.

230<br />

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

Figure 8-15: This workbook demonstrates how to perform a lookup by using the closest match.<br />

The array formula that follows identifies the closest match to the Target value in the Data range<br />

and returns the names of the corresponding student in column A (that is, the column with an offset<br />

of –1). The formula returns Leslie (with a matching value of 8,000, which is the one closest to<br />

the Target value of 8,025).<br />

{=INDIRECT(ADDRESS(ROW(Data)+MATCH(MIN(ABS(Target-Data)),<br />

ABS(Target-Data),0)-1,COLUMN(Data)+ColOffset))}<br />

If two values in the Data range are equidistant from the Target value, the formula uses the first<br />

one in the list.<br />

The value in ColOffset can be negative (for a column to the left of Data), positive (for a column to<br />

the right of Data), or 0 (for the actual closest match value in the Data range).<br />

To understand how this formula works, you need to understand the INDIRECT function. This function’s<br />

first argument is a text string in the form of a cell reference (or a reference to a cell that<br />

contains a text string). In this example, the text string is created by the ADDRESS function, which<br />

accepts a row and column reference and returns a cell address.<br />

Looking up a value using linear interpolation<br />

Interpolation refers to the process of estimating a missing value by using existing values. For an<br />

illustration of this concept, see Figure 8-16. Column D contains a list of values (named x) and column<br />

E contains corresponding values (named y).

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

Saved successfully!

Ooh no, something went wrong!