Vlookup Not Working

Groovy Chick

Board Regular
Joined
Oct 10, 2017
Messages
75
Office Version
  1. 2016
Platform
  1. Windows
Hi, I have two tabs on a spreadsheet called LOPC and Tiers. From the LOPC file I have a formula that looks at the value in cell A2 and so on to find a match in column A on the Tiers tab and return the text in column C at the Tiers tab if it finds a match or no match if it doesn't. I am using the formula
Code:
=IFERROR(VLOOKUP(A2,Tiers!A2:C443,3,FALSE),"No Match")
This works insomuch as it returns No Match but it is returning No Match even when there is a match. Can someone advise me what I am doing wrong? Thank you.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
What do the values in column A on each sheet look like?
Also, if you are copying this formula down the column, you will need to lock your lookup range like this (before copying the formula down):
Rich (BB code):
=IFERROR(VLOOKUP(A2,Tiers!A$2:C$443,3,FALSE),"No Match")
 
Upvote 0
What do the values in column A on each sheet look like?
Also, if you are copying this formula down the column, you will need to lock your lookup range like this (before copying the formula down):
Rich (BB code):
=IFERROR(VLOOKUP(A2,Tiers!A$2:C$443,3,FALSE),"No Match")
Hi, thank you. I tried that but no success, sadly. Both values are formatted as numbers.
 
Upvote 0
Please post some samples of what both numbers look like.

Are both right-justified in the cells, like this?
1695825159832.png


Or are any left-justified, like this?
1695825190105.png
 
Upvote 0
Ideally you want to clean up your data. From the images the 1st is more than likely text while the second one is most likely number.
You don't give the sheet names so we don't know which image is where the A2 is reading from.

Depending on which sheet is which one of these first 2 might work, the last one covers off both cases.

Convert A2 to a number
Excel Formula:
=IFERROR(VLOOKUP(VALUE(A2),Tiers!A$2:C$443,3,FALSE),"No Match")
or
Convert A2 to text
Excel Formula:
=IFERROR(VLOOKUP(TRIM(A2),Tiers!A$2:C$443,3,FALSE),"No Match")

or
Excel Formula:
[CODE=xls]=IFERROR(VLOOKUP(TRIM(A2),Tiers!A$2:C$443,3,FALSE),IFERROR(VLOOKUP(VALUE(A2),Tiers!A$2:C$443,3,FALSE),"No Match"))
 
Upvote 0
The fact that one is left-justified suggests it is a text entry, and the one that is right-justified is a numeric entry.
Whenever using any of the lookup or match functions in Excel, the two data types you are comparing MUST be the same data type!
You cannot match text entries to numeric ones. Either they both need to be numeric, or they both need to be text.

You can use "Text to Columns" on your "text" entries to quickly convert that whole column to numbers.
Then your formulas should work as desired.
 
Upvote 0
Ideally you want to clean up your data. From the images the 1st is more than likely text while the second one is most likely number.
You don't give the sheet names so we don't know which image is where the A2 is reading from.

Depending on which sheet is which one of these first 2 might work, the last one covers off both cases.

Convert A2 to a number
Excel Formula:
=IFERROR(VLOOKUP(VALUE(A2),Tiers!A$2:C$443,3,FALSE),"No Match")
or
Convert A2 to text
Excel Formula:
=IFERROR(VLOOKUP(TRIM(A2),Tiers!A$2:C$443,3,FALSE),"No Match")

or
Excel Formula:
[CODE=xls]=IFERROR(VLOOKUP(TRIM(A2),Tiers!A$2:C$443,3,FALSE),IFERROR(VLOOKUP(VALUE(A2),Tiers!A$2:C$443,3,FALSE),"No Match"))
Thank you, Alex. I had converted both to numbers and aware that data types need to be the same. All working now.
 
Upvote 0
The fact that one is left-justified suggests it is a text entry, and the one that is right-justified is a numeric entry.
Whenever using any of the lookup or match functions in Excel, the two data types you are comparing MUST be the same data type!
You cannot match text entries to numeric ones. Either they both need to be numeric, or they both need to be text.

You can use "Text to Columns" on your "text" entries to quickly convert that whole column to numbers.
Then your formulas should work as desired.
Thank you, Joe. I was aware that the data types had to be the same and thought I had converted both to numbers, my fault. All working now, thank you for your help.
 
Upvote 0
You are welcome.
Glad we were able to help.
 
Upvote 0

Forum statistics

Threads
1,215,123
Messages
6,123,181
Members
449,090
Latest member
bes000

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