Date and Time Stamp

gymwrecker

Active Member
Joined
Apr 24, 2002
Messages
390
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Is it possible to add a formula or instruction to a standard text in excel so when I copy and paste it will automatically add the date and time stamp?

This is a sample of a standard text I use since I approve 100's of personnel actions a day:

"Approved by Mr. John Doe on 05 May 23, 12:12 PM"

Can the underline date and time appear automatically when I copy in any particular cell?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Upvote 1
here is a better version:

mr excel questions 34.xlsm
ABCD
1
2
3Date:2023-05-05
4Status:Approved
5Approved BY:gymwrecker
6
7Approved by gymwrecker on 05 May, 2023
gymwrecker
Cell Formulas
RangeFormula
B7B7=IF(SUM(--(B3:B5<>""))=3,B4&" by "&B5&" on "&TEXT(B3,"dd mmm, yyyy"),"")
Cells with Data Validation
CellAllowCriteria
B3Date=TODAY()
B4Custom=AND(LEN(B4)>0,B4="Approved")
B5Custom=AND(B3=TODAY(),B4="Approved")
 
Upvote 1
have you tried to set up the data validation as I have put in the post?

Here it is again, without the TODAY() function as the value (It still uses the today function in the validation (so it is getting that as a timestamp and it will not change with time):
mr excel questions 34.xlsm
ABCDE
1
2
3Date:2023-05-05
4Status:Approved
5Approved BY:gymwrecker
6
7Approved by gymwrecker on 05 May, 2023
gymwrecker
Cell Formulas
RangeFormula
B7B7=IF(SUM(--(B3:B5<>""))=3,B4&" by "&B5&" on "&TEXT(B3,"dd mmm, yyyy"),"")
Cells with Data Validation
CellAllowCriteria
B3Date=TODAY()
B4Custom=AND(LEN(B4)>0,B4="Approved")
B5Custom=AND(B3=TODAY(),B4="Approved")
 
Upvote 1
I hope all this explains it correctly now. It seems to work for me:
But you should format B3 as a date and time format (to your comfortable format, but should have h:m:s as well).

mr excel questions 34.xlsm
AB
1
2
3Date:2023-05-09 13:37
4Status:Approved
5Approved BY:gymwrecker
6
7Approved by gymwrecker on 09 May, 2023 @ 13:37:00
gymwrecker
Cell Formulas
RangeFormula
B7B7=IF(SUM(--(B3:B5<>""))=3,B4&" by "&B5&" on "&TEXT(B3,"dd mmm, yyyy") & " @ " & TEXT(B3,"hh:mm:ss"),"")
Cells with Data Validation
CellAllowCriteria
B3Custom=AND(B3>(NOW()-TIME(0,5,0)),B3<(NOW()+TIME(0,5,0)))
B4Custom=AND(LEN(B4)>0,B4="Approved")
B5Custom=AND(B3>(NOW()-TIME(0,5,0)),B3<(NOW()+TIME(0,5,0)),B4="Approved")




Data validation error message for the date entry:

1683653969634.png



Data validation error message for the "Approved" entry:

1683654026507.png




Data validation error message for the Approver's name (this also checks the date again):
1683654147960.png
 
Upvote 1
Solution
Okay. The approaches although it seems that Date vs DateTime values would be an easy switch this exercise showed me that it is not. So if you do want to convert, you should come back to here for the last set up I posted.

Best wishes!
 
Upvote 1
Cell Formulas
RangeFormula
B12B12=Stamp(17,3,15,15)



Minor edit to the new function "Stamp"
=LAMBDA(Day,Month,Hour,Minute,LET(d, Day, mo, Month, h, Hour, m, Minute, "Approved By: gymwrecker " & TEXT(DATE(2023, mo, d) + TIME(h, m, 0), "d-mmm-yy h:mm Am/PM")))

N.B. Next year, you will have to edit the year part 2023 to 2024. It could be a new function say Stamp24
 
Upvote 1
"Following your example on Post #36, B12 =STAMP(17,3,1515)"

Please check your data entry, the quote above is missing a comma. It should be =STAMP(17,3,15,15)

For a different date and time, you enter or edit the formula with the necessary parameters.

Cell Formulas
RangeFormula
B12B12=Stamp(17,3,15,15)
B13B13=Stamp(18,3,15,20)
B14B14=Stamp(10,5,15,20)
 
Last edited:
Upvote 1
Here is a stab at it:
This has data validation to ensure data entered.


mr excel questions 34.xlsm
ABCDE
1
2
3Date:2023-05-05
4Status:Approved
5Approved BY:gymwrecker
6
7Approved by gymwrecker on 05 May, 2023
gymwrecker
Cell Formulas
RangeFormula
B7B7=B4 & " by " & B5 & " on " & TEXT(B3,"dd mmm, yyyy")
Cells with Data Validation
CellAllowCriteria
B3Date=TODAY()
B4Custom=AND(LEN(B4)>0,B4="Approved")
B5Custom=AND(B3=TODAY(),B4="Approved")
 
Upvote 0
DRSteele, it worked, the only problem is that it returns 12:00 AM every single time.... thoughts?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,586
Messages
6,125,683
Members
449,249
Latest member
ExcelMA

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