Google-sheets – Copy Date Value and Paste as actual Date not number

copy/pastegoogle sheets

I have a Google sheet with a cell (D1) that contains a formula (=TODAY()) to show the current date. I am trying to create a macro that will simply copy the value of D1 as displayed (e.g., "5/18/2018") instead of the formula and then display that value as an actual date (i.e., "5/18/2018"). When I use Google sheets PASTE SPECIAL (Paste Value Only) it actually displays the number "43238" instead of "5/18/2018". How do make it paste the actual date instead of the number?

Best Answer

You would use the text function.

If you have =today() in A1, you would use =text(A1,"mm/dd/yyyy"). (There are multiple formats for 'mm/dd/yyyy' if that's not the format you want.)

Alternatively you can pre-format the cell as a date, so pasting the value would automatically be displayed as a date.