#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 271
Default VLOOKUP Question

Hello All,

Problem with a VLOOKUP. EX: When "Elmer Fudd" is chosen from the drop down
in a spreadsheet, EF should auto appear in the appropriate colmun. But "AP"
for APPLE PIE shows up. All others work.
Formula is =IF(C2=0," ",(VLOOKUP(C2,$AM$1:$AN$11,2)))
COLUMN AM COLUMN AN
ROW1 APPLE PIE AP
2 GREEN BEANS GB
3 RED APPLES RB
4 ORANGE CARROTS OC
5 LIMA BEANS LB
6 SNOW WHITE SW
7 BUGS BUNNY BB
8 ELMER FUDD EF

Thank you everyone!
COLUMN AM HOLDS THE NAME AND COLUMN AN HOLDS THE INITIALS

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,549
Default VLOOKUP Question


Add comma zero after the last number...
=IF(C2=0," ",(VLOOKUP(C2,$AM$1:$AN$11,2,0)))
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Susan"
wrote in message
Hello All,
Problem with a VLOOKUP. EX: When "Elmer Fudd" is chosen from the drop down
in a spreadsheet, EF should auto appear in the appropriate colmun. But "AP"
for APPLE PIE shows up. All others work.
Formula is =IF(C2=0," ",(VLOOKUP(C2,$AM$1:$AN$11,2)))
COLUMN AM COLUMN AN
ROW1 APPLE PIE AP
2 GREEN BEANS GB
3 RED APPLES RB
4 ORANGE CARROTS OC
5 LIMA BEANS LB
6 SNOW WHITE SW
7 BUGS BUNNY BB
8 ELMER FUDD EF

Thank you everyone!
COLUMN AM HOLDS THE NAME AND COLUMN AN HOLDS THE INITIALS

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 353
Default VLOOKUP Question

You should also be getting a wrong answer for orange carrots, lima beans, and
bugs bunny... with the way you have the vlookup set up, it's looking for the
closest match. In order to get the right answer, your data must be sort in
ascending order. Once it finds a match that exceeds the lookup value, it
gives the previous row as the answer. You get AP for Elmer Fudd, because
Elmer Fudd would fall between Apple Pie and Green Beans, so AP is the closest
match. You should get GB for Orange Carrots and Lima Beans and AP for Bugs
Bunny for the same reason.
You can reorder your data or change your formula to only find an exact match:
=IF(C2=0,"",(VLOOKUP(C2,$AM$1:$AN$11,2,0)))


"Susan" wrote:

Hello All,

Problem with a VLOOKUP. EX: When "Elmer Fudd" is chosen from the drop down
in a spreadsheet, EF should auto appear in the appropriate colmun. But "AP"
for APPLE PIE shows up. All others work.
Formula is =IF(C2=0," ",(VLOOKUP(C2,$AM$1:$AN$11,2)))
COLUMN AM COLUMN AN
ROW1 APPLE PIE AP
2 GREEN BEANS GB
3 RED APPLES RB
4 ORANGE CARROTS OC
5 LIMA BEANS LB
6 SNOW WHITE SW
7 BUGS BUNNY BB
8 ELMER FUDD EF

Thank you everyone!
COLUMN AM HOLDS THE NAME AND COLUMN AN HOLDS THE INITIALS

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 271
Default VLOOKUP Question

Many thanks to you BoniM for taking time to help

"BoniM" wrote:

You should also be getting a wrong answer for orange carrots, lima beans, and
bugs bunny... with the way you have the vlookup set up, it's looking for the
closest match. In order to get the right answer, your data must be sort in
ascending order. Once it finds a match that exceeds the lookup value, it
gives the previous row as the answer. You get AP for Elmer Fudd, because
Elmer Fudd would fall between Apple Pie and Green Beans, so AP is the closest
match. You should get GB for Orange Carrots and Lima Beans and AP for Bugs
Bunny for the same reason.
You can reorder your data or change your formula to only find an exact match:
=IF(C2=0,"",(VLOOKUP(C2,$AM$1:$AN$11,2,0)))


"Susan" wrote:

Hello All,

Problem with a VLOOKUP. EX: When "Elmer Fudd" is chosen from the drop down
in a spreadsheet, EF should auto appear in the appropriate colmun. But "AP"
for APPLE PIE shows up. All others work.
Formula is =IF(C2=0," ",(VLOOKUP(C2,$AM$1:$AN$11,2)))
COLUMN AM COLUMN AN
ROW1 APPLE PIE AP
2 GREEN BEANS GB
3 RED APPLES RB
4 ORANGE CARROTS OC
5 LIMA BEANS LB
6 SNOW WHITE SW
7 BUGS BUNNY BB
8 ELMER FUDD EF

Thank you everyone!
COLUMN AM HOLDS THE NAME AND COLUMN AN HOLDS THE INITIALS

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 271
Default VLOOKUP Question

Thank you Jim for your time. Your help is much appreicated.

"Jim Cone" wrote:


Add comma zero after the last number...
=IF(C2=0," ",(VLOOKUP(C2,$AM$1:$AN$11,2,0)))
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Susan"
wrote in message
Hello All,
Problem with a VLOOKUP. EX: When "Elmer Fudd" is chosen from the drop down
in a spreadsheet, EF should auto appear in the appropriate colmun. But "AP"
for APPLE PIE shows up. All others work.
Formula is =IF(C2=0," ",(VLOOKUP(C2,$AM$1:$AN$11,2)))
COLUMN AM COLUMN AN
ROW1 APPLE PIE AP
2 GREEN BEANS GB
3 RED APPLES RB
4 ORANGE CARROTS OC
5 LIMA BEANS LB
6 SNOW WHITE SW
7 BUGS BUNNY BB
8 ELMER FUDD EF

Thank you everyone!
COLUMN AM HOLDS THE NAME AND COLUMN AN HOLDS THE INITIALS


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup question Tremag Excel Worksheet Functions 3 June 2nd 07 07:34 AM
VLOOKUP question Jonah Excel Discussion (Misc queries) 1 November 9th 06 05:18 AM
Vlookup question aka_krakur Excel Discussion (Misc queries) 2 July 29th 06 12:17 AM
VLOOKUP question Tom Weston Excel Discussion (Misc queries) 1 February 13th 06 11:03 AM
VLOOKUP question rmellison Excel Discussion (Misc queries) 5 November 18th 05 12:46 PM


All times are GMT +1. The time now is 03:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"