How can I convert a date to the YYYYMMDD format in Google Sheets?

To convert a date to the YYYYMMDD format in Google Sheets, you can use the TEXT function. First, select the cell where you want the converted date to appear. Then, type “=TEXT(A1,”YYYYMMDD”)” in the formula bar, where A1 is the cell containing the original date. This will convert the date to the specified format and display it in the selected cell. You can also customize the format by changing the “YYYYMMDD” part in the formula to any other combination of letters and symbols.


You can use the following formula to convert a date to a YYYYMMDD format in Google Sheets:

=TEXT(A1, "YYYYMMDD")

This will convert a date such as 1/4/2023 to a format of 20230104.

You can also use the following formula to insert dashes between the year, month and day:

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

This will convert a date such as 1/4/2023 to a format of 2023-01-04.

Note that each formula assumes the date is in cell A1.

The following example shows how to use each formula in practice.

Example: Convert Date to YYYYMMDD Format in Google Sheets

We can use the following formula to convert a date to a YYYYMMDD format in Google Sheets:

=TEXT(A2, "YYYYMMDD")

We can type this formula into cell B2 and drag the formula down to every remaining cell in column B:

Google Sheets convert date to YYYYMMDD format

Column B displays each date in column A in a YYYYMMDD format.

For example:

  • 1/4/2023 has been converted to 20230104.
  • 1/6/2023 has been converted to 20230106.
  • 2/3/2023 has been converted to 20230203.

And so on.

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

We can type this formula into cell B2 and drag the formula down to every remaining cell in column B:

Column B displays each date in column A in a YYYY-MM-DD format.

For example:

  • 1/4/2023 has been converted to 2023-01-04.
  • 1/6/2023 has been converted to 2023-01-06.
  • 2/3/2023 has been converted to 2023-02-03.

And so on.

Note: You can find the complete documentation for the Google Sheets TEXT function .

Additional Resources

The following tutorials explain how to perform other common tasks in Google Sheets:

x