Date and Time Stamp

gymwrecker

Active Member
Joined
Apr 24, 2002
Messages
396
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?
 
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

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I did awoohaw, and it works. Thank you!

Just curious if I can also add the time stamp to it. Something like this:
Approved by Mr. John Doe on 09 May, 2023 @12:02
 
Upvote 0
yes, when you enter the date in B3 also add the time component.
Keyboard shortcut would be CTRL-SEMI-COLON space CTRL-COLON (CTRL-SHFT-SEMI-COLON).

you need to change the validation rule for cell B3 substantially. This validates to a 5 minute before and after (you could probably change it to 1 minute if you want. See below:

mr excel questions 34.xlsm
AB
1
2
3Date:2023-05-09 12:26
4Status:Approved
5Approved BY:gymwrecker
6
7Approved by gymwrecker on 09 May, 2023 @ 12:26: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
B3Datenot between (NOW()-INT(NOW())-(5/(60*24))) and (NOW()-INT(NOW())+(5/(60*24)))
B4Custom=AND(LEN(B4)>0,B4="Approved")
B5Custom=AND(B3=TODAY(),B4="Approved")
 
Upvote 0
I used the suggested data validation and I'm still having a problem with the time, not sure what is it that I'm doing wrong or missing:

DATE:2023/05/09
STATUS:Approved
APPROVED BY:Mr. John Doe
Approved by Mr. John Doe on 09 May, 2023 @ 00:00:00
 

Attachments

  • data-validation.png
    data-validation.png
    17.7 KB · Views: 5
Upvote 0
sorry, although we are using dates and times, the validation doesn't seem to like it. So I just am using a custom value.

... working on it!.... sorry
 
Last edited:
Upvote 0
Thank you awoohaw! I fixed it, but still showing the time as 00:00:00

Approved by Mr. John Doe on 09 May 2023 @ 00:00:00
 

Attachments

  • data-validation.png
    data-validation.png
    41.2 KB · Views: 3
Upvote 0
Ok, i hope this works for you, it just did for me:
mr excel questions 34.xlsm
AB
1
2
3Date:2023-05-09 13:27
4Status:Approved
5Approved BY:gymwrecker
6
7Approved by gymwrecker on 09 May, 2023 @ 13:27: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=TODAY(),B4="Approved")
 
Upvote 0
and how are you entering the date and time in cell B3?
 
Upvote 0
change the format of your cell B3 to: custom format: yyyy-mm-dd hh:mm:ss or mm-dd-yyyy hh:mm:ss or dd-mm-yyyy hh:mm:ss
Whichever format you want. but show the time portion.
 
Upvote 0

Forum statistics

Threads
1,223,708
Messages
6,174,006
Members
452,542
Latest member
Bricklin

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