Multiple Criteria VLOOKUP Formula

Rob0424

New Member
Joined
Jan 9, 2007
Messages
40
Office Version
  1. 2016
I have a VLOOKUP formula that currently works:

=VLOOKUP(C2,'2023 RATES'!$A$1:$F$2000,5)

The problem I am trying to solve is if this formula does not find what it is looking for it returns #N/A. Is there a way to add to this formula that if it does not find anything then it would move onto this formula:

=VLOOKUP(D2,'2023 RATES'!$A$1:$F$2000,4)

And then the problem with adding this is there could be multiple times this is found, so it should stop at the first one found.

Can anyone help me?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
How about
Excel Formula:
=ifna(VLOOKUP(C2,'2023 RATES'!$A$1:$F$2000,5),VLOOKUP(D2,'2023 RATES'!$A$1:$F$2000,4))
 
Upvote 0
Thank you. This kind of works. I'm not sure how it is picking which value to return if it gets to the second VLOOKUP formula though, if there are multiple options to return. When I tested it it seemed to have picked like the third one down.
 
Upvote 0
The vlookup function will always return the 1st match.
 
Upvote 0
Ok then I don't think it is working correctly then. When I test it by just deleting the data enter so the first VLOOKUP cannot be found, it returns a value but it is not the correct one. Does it matter if the value the second VLOOKUP is searching for is Text? This is what I am having it search for Takeuchi TL10CR, which is formatted as text.
 
Upvote 0
Ok, how about
Excel Formula:
=ifna(VLOOKUP(C2,'2023 RATES'!$A$1:$F$2000,5,0),VLOOKUP(D2,'2023 RATES'!$A$1:$F$2000,4,0))
 
Upvote 0
This returns a #N/A when i test it by deleting the data to lookup associated with C2
 
Upvote 0
That means there is no exact match.
 
Upvote 0
OK, but I tried copying the text from cell D2 into the cell on the '2023 Rates' tab so they should match exactly. Any idea why it might not be recognized?
 
Upvote 0
Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,623
Latest member
Techenthusiast

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