Vlookup with two criteria

Sefty

Board Regular
Joined
Apr 5, 2022
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Hello,
I need help, if I have a case to do a vlookup with 2 categories so that if criteria one is not found then it will be searched for with criteria two.
I want to find "price" with the first criteria "code", if can't find it then look for the second criterion "product".
Please help, what is the Vlookup formula for?
Thank you for help....
Book1
BCDEFGHI
1DATABASEVlookup
2ProductCodePriceProductCodePrice
3Shoes1248000Hat156
4Hat15612000Clothes246
5Clothes26750000Skirt500
6Bag65745000Bag657
7Skirt50065000Shoes780
Sheet1
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Seeing as you have 365 then maybe

Book1.xlsb
ABCDEFGHI
1DATABASEVlookup
2ProductCodePriceProductCodePrice
3Shoes1248000Hat15612000
4Hat15612000Clothes24650000
5Clothes26750000Skirt50065000
6Bag65745000Bag65745000
7Skirt50065000Shoes7808000
Sheet1
Cell Formulas
RangeFormula
I3:I7I3=XLOOKUP(H3,$C$3:$C$7,$D$3:$D$7,XLOOKUP(G3,$B$3:$B$7,$D$3:$D$7,""))
 
Upvote 0
For those of us who don't have 365 :cry:

Dante Amor
ABCDEFGHI
1DATABASE
2ProductCodePriceProductCodePrice
3Shoes1248000Hat15612000
4Hat15612000Clothes24650000
5Clothes26750000Skirt50065000
6Bag65745000Bag65745000
7Skirt50065000Shoes7808000
8Coat800does not exist
Hoja5
Cell Formulas
RangeFormula
I3:I8I3=IFERROR(VLOOKUP(H3,$C$2:$D$7,2,0),IFERROR(VLOOKUP(G3,$B$2:$D$7,3,0),"does not exist"))
 
Upvote 0
For those of us who don't have 365 :cry:

Dante Amor
ABCDEFGHI
1DATABASE
2ProductCodePriceProductCodePrice
3Shoes1248000Hat15612000
4Hat15612000Clothes24650000
5Clothes26750000Skirt50065000
6Bag65745000Bag65745000
7Skirt50065000Shoes7808000
8Coat800does not exist
Hoja5
Cell Formulas
RangeFormula
I3:I8I3=IFERROR(VLOOKUP(H3,$C$2:$D$7,2,0),IFERROR(VLOOKUP(G3,$B$2:$D$7,3,0),"does not exist"))
WOW Magic, puzzling solved
thanks a lot Master!! 😎
 
Upvote 0

Forum statistics

Threads
1,215,389
Messages
6,124,665
Members
449,178
Latest member
Emilou

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