VLookup with an if statement

tonguencheek

Board Regular
Joined
Apr 6, 2010
Messages
233
I'm looking for a way to use a vlookup in combination with an if statement (or other method to solve for my ask). I will have a table of dates with values next to them. Then in another section I will have a longer list of dates with the formula I'm looking for help with next to each date.

What I would like is a formula (in column B in below) that looks at the first table (in D1-E3 in below) and if the date next to the formula is found, then return the value next to it in that table. Otherwise return the value above the cell with the formula. Below shows the results I would want with the formula in column B.

ABCDE
105/31/18306/01/185
206/01/18507/15/1810
306/15/18508/25/1815
407/15/1810
5

<tbody>
</tbody>


Thanks all!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I am guessing that you are using an older version of Excel that does not have the IFNA function (introduced in Excel 2013)

If that case, perhaps try:
Code:
=IFERROR(VLOOKUP(A2,D$1:E$3,2,0),B1)
or
Code:
=IF(ISNA(VLOOKUP(A2,D$1:E$3,2,0)),B1,VLOOKUP(A2,D$1:E$3,2,0))
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

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