vlookup choice from 2 left hand columns

mistersteve

Board Regular
Joined
Aug 18, 2014
Messages
110
Office Version
  1. 365
Hello all,
Please forgive me if I don't explain properly
Using vlookup from another spreadsheet
I select from the table array as below and select column C as result

However, there are in some instances there is a part number in column B
Therefore, can it be possible to ignore Column A as first left column and choose Column B whenever there is a part number present

A B C
Group Part Number Discount
1 P302 15
2 P311 40
3 P179 25
4 P179 12345 57.62

Hoping this can be answered and thankyou in advance
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
How about
Excel Formula:
=XLOOKUP(A2,Sheet1!$B$2:$B$20,Sheet1!$C$2:$C$20,XLOOKUP(A2, Sheet1!$A$2:$A$20,Sheet1!$C$2:$C$20,"",0),0)
 
Upvote 0
How about
Excel Formula:
=XLOOKUP(A2,Sheet1!$B$2:$B$20,Sheet1!$C$2:$C$20,XLOOKUP(A2, Sheet1!$A$2:$A$20,Sheet1!$C$2:$C$20,"",0),0)
Thank you Fluff, unfortunately i don't have XLOOKUP on office 2016,
is there another way i could use
 
Upvote 0
You could use this:
=vlookup(X,choose({1,2},B:B,A:A),2,0)

where X is your criteria, your data is in columns A and B and the match is in Column B and the needed data is in column A.​
 
Upvote 0
This should give the same result as Fluff's Xlookup.
It assumes the value to lookup is in A2 that is on the same sheet as the formula.

Excel Formula:
=IFERROR(VLOOKUP($A2,Sheet1!$B$2:$C$20,2,FALSE),
       IFERROR(VLOOKUP($A2,Sheet1!$A$2:$C$20,3,FALSE),
          ""))

If anyone else want to try here is the data in XL2BB

20210730 Vlookup nested.xlsx
ABCD
1GroupPart NumberDiscount
2P30215
3P31140
4P17925
5P1791234557.62
6
Sheet1
 
Upvote 0
In that case I would suggest you change your profile to show 2016 & when a 365 solution is ok say so in your post.

Alex's formula works for me.
 
Upvote 0

Forum statistics

Threads
1,214,392
Messages
6,119,254
Members
448,879
Latest member
oksanana

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