Weird problem with Lookup function

ammylar5

New Member
Joined
Feb 27, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
This my formula: =LOOKUP(H2,Advisors!B:B,Advisors!C:C)
This is the result:
1614458254005.png

The Advisorid = 1 is also a formula which refer to a different sheet.
If I change the from a formula by entering the # 1 - the lookup works
1614458120975.png

However if instead of entering the 1 I do a copy the column and past value the formula will not work.
Weird but here it is. If you can help great, I really don't want to have to enter a # in the column by hand, too many rows.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi & welcome to MrExcel.
What is the formula in H2?
 
Upvote 0
Probably a difference in data type: text vs numeric. Looks can be deceiving, and the cell formatted does not matter.

Use =ISTEXT(H2) and =ISTEXT(B123) to determine data type, assuming B123 is the intended match.

And if both are text, compare =LEN(H2) and =LEN(B123) to be sure there are no extraneous characters that you are overlooking.

Also note that LOOKUP (sic) expects column B to be in ascending order.

You might want to consider using VLOOKUP(H2, Advisors!B:C, 2, FALSE) to force an exact match without requiring ordered data in column B.

Or equivalently: INDEX(Advisors!C:C, MATCH(H2, Advisors!B:B, 0)).

PS: I deprecate the use of full-column references like B:B. $B$1:$B$1000 is better, changing 1000 if necessary.
 
Upvote 0
Probably a difference in data type: text vs numeric. Looks can be deceiving, and the cell formatted does not matter.

Use =ISTEXT(H2) and =ISTEXT(B123) to determine data type, assuming B123 is the intended match.

And if both are text, compare =LEN(H2) and =LEN(B123) to be sure there are no extraneous characters that you are overlooking.

Also note that LOOKUP (sic) expects column B to be in ascending order.

You might want to consider using VLOOKUP(H2, Advisors!B:C, 2, FALSE) to force an exact match without requiring ordered data in column B.

Or equivalently: INDEX(Advisors!C:C, MATCH(H2, Advisors!B:B, 0)).

PS: I deprecate the use of full-column references like B:B. $B$1:$B$1000 is better, changing 1000 if necessary.
Thank you so much for taking the time. I understood everything you said and had already done trying to solve the problem but could not solve the problem. So I thought that may be my workbook was corrupted. I created a brand new workbook and used the VLOOKUP as you suggested and it worked. Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,960
Latest member
AKSMITH

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