VLOOKUP strange behavior

ezdmanx

New Member
Joined
Nov 2, 2023
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
Can anyone tell me why this shows an incorrect value in the worksheet at the link below?

1698927161921.png


https://www.dropbox.com/scl/fi/t21ab6iiu2tiic829yy72/Prob.xlsx?rlkey=9nk2ks90bmj72lygrouoflr53&dl=1


I cannot figure it out.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
What is the formula? I'm not really keen on clicking a link from a first time visitor to the forum, there is a phishing risk in that.
If possible please use the xl2bb add in to post a mini worksheet (Link below).

this formula could work:
in cell B2 and copy down:

Excel Formula:
=SUBSTITUTE(A2,"WT-","")
 
Last edited by a moderator:
Upvote 0
I don't know the reason why it is displaying the previous record if you have two records starting with the same letter(F-FL,FR)
But I know the solution. If you don't input the "matching type" argument in the formula, the default value will be TRUE, which means it will always make a close match. If you want to make an exact match, you must set it to FALSE(0).
Excel Formula:
=VLOOKUP($A2,Sheet2!$A$2:$E$13,2,0)
However I don't understand this behaviour in close match. Very strange.
 
Upvote 0
Because you are using an approximate match the data must be sorted ascending. If you change the order of the data on Sheet2 to this
Prob.xlsx
AB
1Window TypeType
2WT-AA
3WT-BB
4WT-CC
5WT-DD
6WT-EE
7WT-FLFL
8WT-FRFR
9WT-GG
10WT-HH
11WT-JJ
Sheet2
It will work.

But as you have WT-FR before WT-FL it returns the value for WT-E.
HTH
 
Upvote 0
WT-FR comes after WT-FL alphabetically & so vlookup will return the next lowest value to WT-FL which is WT-E
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,139
Members
453,021
Latest member
Justyna P

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