18.11.2014 Views

Microsoft Office

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

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

Part II<br />

Working with Formulas and Functions<br />

Using the VLOOKUP function requires that the lookup range (in this case, the Players range) is in ascending<br />

order. In addition to this limitation, the formula suffers from a slight problem: If you enter a nonexistent<br />

player (in other words, the LookupValue cell contains a value not found in the Players range), the formula<br />

returns an erroneous result.<br />

A better solution uses the INDEX and MATCH functions. The formula that follows works just like the previous<br />

one except that it returns #N/A if the player is not found. Another advantage is that the player names<br />

need not be sorted.<br />

=INDEX(Averages,MATCH(LookupValue,Players,0))<br />

FIGURE 15.7<br />

The VLOOKUP function can’t look up a value in column B, based on a value in column C.<br />

Performing a case-sensitive lookup<br />

The Excel lookup functions (LOOKUP, VLOOKUP, and HLOOKUP) are not case sensitive. For example, if<br />

you write a lookup formula to look up the text budget, the formula considers any of the following a match:<br />

BUDGET, Budget,orBuDgEt.<br />

Figure 15.8 shows a simple example. Range D2:D7 is named Range1, and range E2:E7 is named Range2.<br />

The word to be looked up appears in cell B1 (named Value).<br />

FIGURE 15.8<br />

Using an array formula to perform a case-sensitive lookup.<br />

282

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

Saved successfully!

Ooh no, something went wrong!