If Then Statement with Dates and Vlookup

cmschmitz24

Board Regular
Joined
Jan 27, 2017
Messages
144
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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
67,826
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,589
Messages
5,765,314
Members
425,272
Latest member
Umba

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
Top