Excel: Convert DateTime Column to Text

Raymond Tang Raymond Tang 0 322 0.23 index 8/18/2021

TEXT function can be used in Excel to convert DATETIME column to a text column with provided format.

Code snippet

=TEXT(A1,"YYYY-MM-DD HH:mm:ss")

20210818100343-image.png

To YYYY-MM-DD

=TEXT(A1,"YYYY-MM-DD")

To AM/PM

=TEXT(A1,"YYYY-MM-DD HH:mm:ss AM/PM")

More format

TEXT function - Office Support (microsoft.com)


Join the Discussion

View or add your thoughts below

Comments