2 VLOOKUP functions in one cell

HowlingWulf

New Member
Joined
Jun 28, 2013
Messages
7
Hi there,
I am trying to get a cell to vlookup from two different columns of one table dependent on the result of a different cell.

For example, if the 'total spaces required' (AB4) equals 3 or less, then it needs to look up in column 2 of the postcode table (psc_items), if it's more than 3 then it needs to look up in column 3.
This is the formula I have written but excel tells me it is wrong:

=IF(AB4<4,(VLOOKUP($A$4,psc_items,2,FALSE)),AB4>3(VLOOKUP($A$4,psc_items,3,FALSE)))

I tried the INDEX MATCH formula but I have not used it before so didn't quite understand it and wasn't entirely sure it was right for what I wanted.

There is more to my spreadsheet but for now if I can get this to work then the next will hopefully be a little easier...I hope.
I have got images but this website says I need to link a URL and I don't have that function at work.

Any help would be greatly appreciated.

Thanks

Wulf
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
"...(AB4) equals 3 or less, then it needs to look up in column 2 of the postcode table (psc_items), if it's more than 3 then it needs to look up in column 3..."

Your formula should say

=IF(AB4<=3,VLOOKUP($A$4,psc_items,2,FALSE),VLOOKUP($A$4,psc_items,3,FALSE))

If AB4 is less than or equal to 3 VLOOKUP using column 2, otherwise AB4 MUST be greater than 3 so no need to check for it, just VLOOKUp from column 3

However you can shorten this entire formula to

=VLOOKUP($A$4,psc_items,IF(AB4<=3,2,3),FALSE)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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