How can i show today's date using IF formula

rockingstar

New Member
Joined
Aug 8, 2015
Messages
5
IF 'A1' is 0 then i want to display today's date in 'B2'
what formula i can use??
pls help..
Thank you
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Welcome to the forum.

Try this entered in B2

=if(a1=0,today(),"")

You don't say what to do if A1 is not 0, so "" will make B2 blank.
 
Upvote 0
Thanks for reply,
I tried that formula but i'am getting some strange answer. I'am getting '42225' as result in B2.
 
Upvote 0
Try this:
Put this formula in B2
If A1 is Empty:
=IF(A1="",TODAY(),"")
If A1 is Zero
=IF(A1="0",TODAY(),"")

You need to set the formatting of B2 to "Date"
 
Upvote 0
Thanks for reply,I tried that formula but i'am getting some strange answer. I'am getting '42225' as result in B2.

42225 is today as a number, format as a date and it will display correctly.

Excel treats dates as a value counting from 1/1/1900 which = 1.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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