Lookup give a wrong value, how could I fix it?

alice9527

New Member
Joined
Jan 16, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi guys, trying to fix this issue. The formulas were written by somebody else.

This is my formula:
=IFERROR(LOOKUP('QCP Review Data'!H10,'Group list'!A:A,'Group list'!B:B),"")

Data in Group list A:A are different test codes, and B:B are several groups.

So theoretically, the formula should be looking for which group the test code belongs to when a test code is entered.

But don't know why some of them are giving wrong results.

Magically half-fixed the issue by moving rows in the "Group list"

Photo 1 is part of the original sheet. When test codes "W0200-15" and "W0202-15" are entered, excel gives me "Enviro" rather than "Fats"

Photo 2 is the half-fixed sheet, which fixed the previous issue, but when entering " W0800-15" and "W3100-15", excel gives me "Powders" rather than "Enviro"

I've tried to sort all data in the "Group list" by alphabetical order, but everything goes wrong with that.

Really appreciate if anyone have an idea why it goes wrong and how could it be fixed.
 

Attachments

  • 1.png
    1.png
    8.8 KB · Views: 21
  • 2.png
    2.png
    8.8 KB · Views: 19

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi & welcome to MrExcel.
How about
Excel Formula:
=XLOOKUP(H10,'Group list'!A:A,'Group list'!B:B,"",0)
 
Upvote 0
Solution
It works! :love: Thank you so much!

But I don't want the cell show "0" when H10 is empty, so I made it looks like this

=IF(H10="","",XLOOKUP(H10,'Group list'!A:A,'Group list'!B:B,"",0))

Is that alright?
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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