2 vlookups in 1 formula

Dummy Excel

Well-known Member
Joined
Sep 21, 2005
Messages
1,004
Office Version
  1. 2019
  2. 2010
  3. 2007
Platform
  1. Windows
Hi All,
im trying to put 2 vlookups into 1 formula although I just cant get it to work properly. Can someone please help!
vlookup 1
Code:
=VLOOKUP(C3,Sheet2!AD:AE,2,0)

vlookup 2
Code:
=VLOOKUP(C4,Sheet2!B:I,8,0)

appreciate your help
Sam
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
no
basically there could be 2 different responses in 2 different fields. So trying to lookup the first response, if its blank, then display the second response
 
Upvote 0
Try something like;

Code:
=IF(VLOOKUP(C3,Sheet2!AD:AE,2,0)="",VLOOKUP(C4,Sheet2!B:I,8,0),VLOOKUP(C3,Sheet2!AD:AE,2,0))

HTH
 
Upvote 0
ok, ive slightly changed the formula so suit my application more and i have found that the formula works correctly sometimes although for other cells it doesnt.
my formula now is
Code:
=IF(D3="Available","",IF(VLOOKUP(C3,Reverse!AD:AE,2,0)="",VLOOKUP(C3,Reverse!$B$1:AP2001,41,0),VLOOKUP(C3,Reverse!AD:AE,2,0)))

although if i change the first & 3rd vlookup and place it as the 2nd, and place the 2nd vlookup and place it in the first and 3rd, the formula works for that cell although not right across the data. How can i have one formula to work for both cells?

thanks
 
Upvote 0
it looks like you could just use if statements in some cases. what is in C3? are you just trying to say if C3=AE or are you searching the whole columns?
 
Upvote 0
In fact the more I look at it the more wrong it is, once you have performed the vlookup on B1-AP2001, the last piece of the formula is redundant
 
Upvote 0
ill explain in more detail....
i run maintenance for trucks, excavators and excavator trailers - the 3 items are a complete combo. We treat the truck as one unit and the excavator and excavator trailer as another unit (cant transport an excavator without a trailer).
So what im trying to do is if there is something wrong with a trailer we mark it as "unavailable" (otherwise its "available" for use)but at the same time i need to mark the excavator as "unavailable"

in the raw data;
Column B is the registration column of the trailer
Column AD is the registration column of the excavator
Column AP is the original fault for the trailer
Column J is the progress update comments of the repair
Column AE please ignore as it should be AP

hope this helps
 
Upvote 0

Forum statistics

Threads
1,223,905
Messages
6,175,297
Members
452,633
Latest member
DougMo

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