IF Cell = Today THEN 1 ELSE = 0

GreenWizard

Board Regular
Joined
Dec 8, 2013
Messages
106
Is there a formula for determining if a Date & Time is TODAY? For example:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]TIME[/TD]
[TD]TODAY[/TD]
[/TR]
[TR]
[TD]12/13/2018 4:02 AM[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]12/12/2018 8:31 PM[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]12/15/2018 1:02 PM[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]12/13/2018 5:17 PM[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]

Please note the 'TODAY' column. I'm looking for a logic formula that can tell me if it's today or not (1 = YES, 0 = NO).
I've tried using this formula, but it doesn't work >>> =IF(A1=TODAY(),1,0)

Thank you!!!

p.s. The current day for this forum post is 12/13/2018
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
....
and NOW() instead of TODAY() because TODAY() doesn't contain time

two ways:
=IF(A2=NOW(),1,0)
or
=IF(DATE(YEAR(A2),MONTH(A2),DAY(A2))=TODAY(),1,0)
 
Last edited:
Upvote 0
Hi,

How about:


Book1
AB
1TIMETODAY
212/13/2018 4:021
312/12/2018 20:310
412/15/2018 13:020
512/13/2018 17:171
Sheet399
Cell Formulas
RangeFormula
B2=--(INT(A2)=TODAY())
 
Upvote 0
Try:
=IF(DATEVALUE(TEXT(A2,"d/m/yyyy"))=TODAY(),1,0)
 
Upvote 0
I used the following in B1; ="TODAY is "&TEXT(TODAY(),"dd/mm/yyyy")

which uses the volatile today() function only once

and then in B2 I used; =IF(TEXT(LEFT(A2,10),"dd/mm/yyyy")=RIGHT($B$1,10),1,0)

This should reduce the number of times the TODAY() function is on your sheet, which I believe is more efficient.




or you could have a cleaner look:

B1; =TEXT(TODAY(),"dd/mm/yyyy")

B2; =IF(TEXT(LEFT(A2,10),"dd/mm/yyyy")=$B$1,1,0)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
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