IF and VLOOKUP

CRAIG20

Board Regular
Joined
Mar 20, 2006
Messages
228
Hi I have 4 tables: "days1, days2 ,days3 ,days4"

I have a cell B4 which contains a number.

I need a formula that if cell B4 = 30 it VLOOKUPs "days1"
if B4 = 31 it VLOOKUPs "days2"

Many thanks in advance.

Regards

Craig
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
And what do you want as a result?
Can you explain it with examples?
 
Upvote 0
Hi. The existing VLOOKUP I have is: =VLOOKUP(B5,days1,2,FALSE) This works fine but only looksup 1 table.
What I need is a IF function so that if cellB4 = 30 it looksup table "days1"
 
Upvote 0
Try:

Excel Formula:
=VLOOKUP(B5,IF(B4=30,days1,IF(B4=31,days2,IF(B4=29,days3,""))),2,0)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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