If Then Statement with Dates and Vlookup

cmschmitz24

Board Regular
Joined
Jan 27, 2017
Messages
150
I have a date being vlookup'd into column H from a different spreadsheet and then I need to determine if that date is greater than or less than 04/01/21 in column J. If it's older than 04/01/21, I need to have column J return 04/01/21. If it's newer than 04/01/21 then I need to have column J return the date vlookup'd into column H. My formulas are not calculating correctly. Please help.

The formula I have in column J is: =IF(H2>DATEVALUE("04/01/2021"),H2,"04/01/2021")

However, it works for the first row, the next rows are not returning the correct date wanted. Here's an example of what I'm getting -

1622831442377.png


row 2, column J should return 06/01/2021
rows 3-5, column J should return 04/01/2021
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Yes the dates are dd/mm, but the formula should work regardless.
 
Upvote 0
Hmm that isn't pulling in the correct date. Is it because there is a vlookup formula in column H?

1622834077622.png

1622834095447.png
 
Upvote 0
The Vlookup shouldn't make a difference, try formatting col H as general, do you still see dates?
 
Upvote 0
But does col H look like, is it dates or 5 digit numbers?
 
Upvote 0
In that case they are text & not real dates. The best option would be change them to real dates in the column that the vlookup is pulling them from.
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,540
Members
449,038
Latest member
Guest1337

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