IF Statement Using Dates

SAMCRO2014

Board Regular
Joined
Sep 3, 2015
Messages
160
I am trying to create an IF statement that is comparing the date in cell G20 to April 1, 2024. If G20 is less than 2024-04-01 then enter 2024-04-01 in the cell, if false, have the cell = date in G20.

This is my IF statement but it will not copy the data from G20 when false =IF(G20<"2024-04-01","2024-04-01",G20)

The true part of the statement works, I can't figure out why the false statement does not. I tried adding the DATE function with no sucess.

1720020197752.png
This should be 2024-07-04 and not 2024-04-01

Thank you
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Please try =IF(G20<date(2024,4,1), date(2024,4,1),G20)
ie, replace "2024-04-01" with date(2024,4,1)
(assuming it is Apr 1st that you mean)
 
Upvote 0
You could also use:

Excel Formula:
=MAX(G20,date(2024,4,1))
 
Upvote 0

Forum statistics

Threads
1,224,810
Messages
6,181,079
Members
453,021
Latest member
Justyna P

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