Lookup not working correctly

Pinchy

New Member
Joined
Oct 19, 2006
Messages
2
I have a lookup set up to display a number reference against a name that is selectable via validate 'list'.
It all works fine except when one name in the list is selected, it shows the wrong number reference.

Here's 4 lines from the list (which has 150+):

Queen Elizabeth and Queen Mother 27
Queen Elizabeth Hospital, Kings Lyn 66
Queen Elizabeth Hospital, Gateshead 106
Queen Elizabeth Hospital, Woolwich 31

When you select 'Queen Elizabeth Hospital, Gateshead' from the validate list (cell C3), it strangely displays '27' in the cell C4 instead of 106. All other lookups work fine except this one line.

Any ideas?

Many thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
can you add to your post your lookup statement, are you using VLOOKUP if so look at the last parameter as this governs the quality of the lookup for want of a better word, whether it be exact, near etc
 
Upvote 0
Hi, Pinchy
Welcome to the Board !!!!!

check out the helpfiles for LOOKUP
the datatable needs to be sorted
then it will work correctly

kind regards,
Erik
 
Upvote 0
Does the number 27 mean anything on the list? Relate to another hospital?

If so, try making the lookup an exact match by including a ",False" at the end of the formula.

HTH
 
Upvote 0
=LOOKUP(C3,CA10:CA165,CB10:CB165)

Never used VLOOKUP before but would be interested to understand more.

Thanks
 
Upvote 0
lookup cannot get an extra argument (false or 0)
you would need vlookup

  A                                   B   C  D                                   E     F   
1 Queen Elizabeth and Queen Mother    27                                         wrong ok  
2 Queen Elizabeth Hospital, Kings Lyn 66     Queen Elizabeth Hospital, Gateshead 27    106 
3 Queen Elizabeth Hospital, Gateshead 106                                                  
4 Queen Elizabeth Hospital, Woolwich  31                                                   

bn bn

[Table-It] version 06 by Erik Van Geit
Code:
RANGE FORMULA (1st cell)
E2    =LOOKUP(D2,A1:A4,B1:B4)
F2    =VLOOKUP(D2,A1:B4,2,0)

[Table-It] version 06 by Erik Van Geit

(as said: sorted table can be handled with lookup)
 
Upvote 0

Forum statistics

Threads
1,214,414
Messages
6,119,373
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top