18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

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

Creating Formulas That Look Up Values 15<br />

Function<br />

LOOKUP<br />

MATCH<br />

OFFSET<br />

VLOOKUP<br />

Description<br />

Returns a value either from a one-row or one-column range. Another form of the LOOKUP<br />

function works like VLOOKUP but is restricted to returning a value from the last column of a range.<br />

Returns the relative position of an item in a range that matches a specified value.<br />

Returns a reference to a range that is a specified number of rows and columns from a cell or range<br />

of cells.<br />

Vertical lookup. Searches for a value in the first column of a table and returns a value in the same<br />

row from a column you specify in the table.<br />

* Available in Excel 2007 only.<br />

The examples in this chapter use the functions listed in Table 15.1.<br />

Basic Lookup Formulas<br />

You can use the Excel basic lookup functions to search a column or row for a lookup value to return<br />

another value as a result. Excel provides three basic lookup functions: HLOOKUP, VLOOKUP, and LOOKUP.<br />

In addition, the MATCH and INDEX functions are often used together to return a cell or relative cell reference<br />

for a lookup value.<br />

Using the IF Function for Simple Lookups<br />

The IF function is very versatile and is often suitable for simple decision-making problems. The accompanying<br />

figure shows a worksheet with student grades in column B. Formulas in column C use the IF function to<br />

return text: either Pass (a score of 65 or higher) or Fail (a score below 65). For example, the formula in cell C2 is<br />

=IF(B2>=65,”Pass”,”Fail”)<br />

You can “nest” IF functions to provide even more decision-making ability. This formula, for example, returns<br />

one of four strings: Excellent, Very Good, Fair, or Poor.<br />

=IF(B2>=90,”Excellent”,IF(B2>=70,”Very Good”,IF(B2>=50,”Fair”,”Poor”)))<br />

This technique is fine for situations that involve only a few choices. But using nested IF functions can quickly<br />

become complicated and unwieldy. The lookup techniques described in this chapter provide a much better<br />

solution.<br />

275

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

Saved successfully!

Ooh no, something went wrong!