You are here:

# Excel/EXCEL VLOOKUP AND INDEX

Question
Hi
i am working on a spread sheet which have Apples, Oranges and Peaches and so on. I want to create a formula which matched Apples than column D "098" the amount in either column B & C.

So formula may be look for Apples and than look for 098 if both matches than take the amount from either column B or C.

than Apples and 099 the problem is below formula only checks Apples in first row but does not check the 2nd or 3rd and so on.

=IF(VLOOKUP(A1,sheet1!A:D,4,0)="098",VLOOKUP(A1,sheet1!A:D,2,0))it does not work just giving you an idea.

A B C D
Apples 1.0000 1.2288 098
Apples 2.0000 0.9329 099
Apples 3.0000 5.4456 100
Apples 4.0000 0.1302 102
Orange 5.0000 0.1181 098
Orange  6.0000 0.0000 099
Orange  7.0000 0.0000 100
Orange  8.0000 0.7520 102

Thanks

You could use a formula like:
=INDEX(C:C,MATCH("Apples098",\$A\$1:\$A\$8&\$D\$1:\$D\$8,0))
which MUST be entered via ctrl/shift/enter, not just enter.
If Apples & 098 are in cells K1 and L1, you could use
=INDEX(C:C,MATCH(K1&L1,\$A\$1:\$A\$8&\$D\$1:\$D\$8,0))
but the 098 would have to be a text-value, else it'd be seen as plain 98, not 098.

Of course, you can change the \$8 in the above formulas to \$100 or wherever the last used row is.
Also, I used C:C for the 3rd coloumn -- if you wanted the 2nd column, use B:B

HTH
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

#### Bob Umlas

##### Expertise

I`m a Microsoft Excel MVP (Most Valuable Professional) and have been since the inception of the program in 1995. I can answer every kind of Excel question except: API, Importing/exporting to other programs (powerpoint, word,...) Also check out my in-person training link at http://www.thumbtack.com/ny/new-york/excel-training/

##### Experience

Worked with MS Excel since version 0.99 (on the Mac!). Was contributing editor to Excellence Magazine, having written >300 articles. John Walkenbach said of me "I finally met someone who knows as much about Excel as I do."

Publications
Excellence, The Expert, Microsoft

Education/Credentials
BA in math, Hofstra University, 1965

Awards and Honors
MVP
Led sessions for the Convergence 2004-2006 seminar on Excel tips & tricks