IF statement

Deaddog

Board Regular
Joined
Mar 6, 2008
Messages
69
Should be an easy one for you guys, I'm trying to produce a time/date stamp without using VB code, needs to be a simple formula.

I'm trying this "=IF(F6="","",(now))" but it returns "#NAME?"

Any suggestions?

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"
should be

=IF(F6="","",now())

and format cell as time
 
Last edited:
Upvote 0
that works, but I need the time to stay static (time stamp)

the time and date changes to current when I reopen sheet.
 
Upvote 0
try this:

Code:
sub do_time()
dim x as date
x = now()
putrangehere = "=if(f6 = "", "", x)"
 
Upvote 0
The problem is that a cell can either have a hard-coded values, or a formula. A formula that returns the current date/time is dynamic (always changing).
So you cannot do anything automatically without VBA.

However, you can use keyboard shortcuts and/or circular references to enter date/time stamps.
See here: https://trumpexcel.com/date-timestamp-excel/
 
Upvote 0
honestly don't know if you can do this with a formula, might have to ask one of the guru's.
 
Upvote 0
honestly don't know if you can do this with a formula, might have to ask one of the guru's.
See my reply above.
 
Upvote 0
thanks for all the answers, I can do it with VBA, but when I put the sheet online it removes the VBA, that's why I'm trying to do it with a formula.
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

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