Formula To Post Date In A Cell The Day Another Cell Is Updated?

Dhira

Board Regular
Joined
Feb 23, 2006
Messages
85
Office Version
  1. 2021
Platform
  1. Windows
How do I post a date in a cell to show the date that a value was entered into another cell?

=IF(AZ312>0,Today(),"")

The issue is I need "Today()" to remain 'printed' on the day it was calculated. So that the next day, it still shows the actual day the referenced cell was updated.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
you will need to turn off iterations on the settings to avoid circular references

I dont normally post weblinks as a solution, BUT

its probably easier to explain with this article which has images for the settings for windows (as i have a Macbook and so different)


Also - see article point 3 here

it also has a VBA solution, I do not provide VBA here
 
Upvote 0
Solution
Edit: I started writing VBA solution before above was postedn as iterations/circular references approach affects also other calculations.


The formula can't do that in standard way. Standard solution in this case would be to use VBA code - Sheet Change event.

If you can have macro enabled workbook then:
You may right-click on tab with sheet name, click on Display Code, paste the following in the window which shall be visible:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim acell As Range, rng As Range
Set rng = Intersect(Target, Range("AZ312:AZ412"))
If Not rng Is Nothing Then
  For Each acell In rng
    If acell > 0 And Range("BA" & acell.Row) = "" Then Range("BA" & acell.Row) = Date
  Next acell
End If
End Sub


Close VBA editor and retun to your workbook. Save it in macro enabled format (xlsm, xlsb). Close and reopen file making sure macros are enabled.

Try writing something in AZ312
BA312 shall show todays date (make sure this cell has a date format)

Comments:
I assumed the issue is not just for one cell but for many cells in one column (change range in line 3)
I assumed the date will be (in BA column - change it to proper column name in line 6 of the code
I assumed that "a value was entered" means manual entering, not the formula in AZ312 which calculated as >0
I assumed that once something is written in AZ the date in BA staus untouched even if next week you change value in AZ again. If that's not the case, and you want to record date of last change in AZ delete
And Range("BA" & acell.Row) = ""
in line 6
 
Upvote 0
Thanks,
you will need to turn off iterations on the settings to avoid circular references

I dont normally post weblinks as a solution, BUT

its probably easier to explain with this article which has images for the settings for windows (as i have a Macbook and so different)


Also - see article point 3 here

it also has a VBA solution, I do not provide VBA here
I used the non-VBA solution. & formula came out to:

=IFS(AY312="","",AZ312<>"",AZ312,1*1,Now())

[Where the formula is placed in cell AY312]
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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