Skip to content

Date shows as a number (45418) when joined with & in Google Sheets — fix with TEXT

Updated

You write ="Due "&A2 and the cell shows Due 45418 instead of Due 2024-05-06. A2 looks like a date. The formula is not #VALUE!. & does not use the painted format. It uses the value Sheets stores, and a date is stored as a serial number. Currency, percent, and time do the same thing: the dollars, the %, and the clock face disappear, and a raw number is glued into the string.

This page is concatenation of formatted numbers. The difference between TO_TEXT (keeps the cell format) and TEXT (follows the pattern you pass) is TO_TEXT vs TEXT. A bad TEXT pattern is TEXT format codes. Keep the Google Sheets UI in English. File → Settings → Locale → United States for the recreates below so the serial and the patterns match the numbers in the shots.

  1. Open a blank spreadsheet. In A1 type day. In A2 enter =DATE(2024,5,6). Format A2 as a date if it shows a serial (Format → Number → Date). A2 displays 5/6/2024 (or your locale’s date). The stored value is still 45418. You can confirm by temporarily setting Format → Number → Number; set it back to Date before you continue.

Join with &. In C1 type amp. In C2 enter ="Due "&A2. C2 is Due 45418. No triangle. The word is there. The date is not. Leave C2 as that string.

C2 selected. Formula bar shows ="Due "&A2. C2 is Due 45418. A2 displays 5/6/2024 as a date. No error triangle.

Currency and percent lose their symbols too. In A4 type amount. In B4 type 1234.5. Format → Number → Currency. B4 displays $1,234.50. In C4 enter ="Pay "&B4. C4 is Pay 1234.5 (or Pay 1234.50). The $ and the thousands separator did not come along. In A6 type pct. In B6 type 0.2. Format → Number → Percent. B6 displays 20%. In C6 enter ="Rate "&B6. C6 is Rate 0.2, not Rate 20%. Leave C4 and C6 broken.

C4 selected. Formula bar shows ="Pay "&B4. C4 is Pay 1234.5. B4 displays $1,234.50. C6 is Rate 0.2. B6 displays 20%. No error triangle.

Time is a fraction. In A8 type when. In B8 enter =TIME(14,30,0). Format B8 as time so it displays 2:30:00 PM. In C8 enter ="At "&B8. C8 is At 0.6041666667 (the exact decimals may be longer). That is 14.5 / 24, not a clock. Leave C8 broken.

C8 selected. Formula bar shows ="At "&B8. C8 is At 0.60416666666667. B8 displays 2:30:00 PM. No error triangle.

A control that already looks right. In E2 enter ="Due "&TEXT(A2,"yyyy-mm-dd"). E2 is Due 2024-05-06. In E4 enter ="Pay "&TEXT(B4,"$#,##0.00"). E4 is Pay $1,234.50. Those two cells stay as the fix targets.

  • A date is a number. DATE(2024,5,6) is serial 45418 (days from Sheets’ epoch). The date format only changes how A2 is painted. & and CONCATENATE read the unformatted value.
  • Currency and percent are also formats on numbers. $1,234.50 is still 1234.5. 20% is still 0.2. Time is a fraction of a day. Joining any of them without a format function drops the display.
  • TEXT(value, format) builds a string from a pattern you control, so yyyy-mm-dd is stable when you send the result to another system. TO_TEXT(value) copies whatever format the cell currently uses, which is convenient on the screen and less stable if someone later changes the column format. That contrast is TO_TEXT vs TEXT.
  • Math on the joined string is a different failure. "Due 45418"+1 is #VALUE! because the result is text. That is not this page’s silent serial. See VALUE() if you need to parse a number back out.

This is not a date stored as text. A2 is a real date (ISNUMBER is TRUE, ISTEXT is FALSE). Text dates that will not sort or look up are dates stored as text. This is not epoch to date. You are not converting Unix seconds. You are joining a Sheets serial that was already a date.

Leave C2, C4, C6, and C8 as the unformatted joins.

Use TEXT when you care about the pattern. In E2 you already have ="Due "&TEXT(A2,"yyyy-mm-dd"). For a US display date, TEXT(A2,"m/d/yyyy") returns 5/6/2024. For a time, ="At "&TEXT(B8,"h:mm AM/PM") returns At 2:30 PM. Illegal patterns are TEXT format codes. Currency patterns that do not follow the locale symbol are locale currency format.

E2 selected. Formula bar shows ="Due "&TEXT(A2,"yyyy-mm-dd"). E2 is Due 2024-05-06. C2 is still Due 45418 from the unformatted join. A2 displays 5/6/2024.

Use TO_TEXT when the cell already displays the string you want. In E6 enter ="Due "&TO_TEXT(A2). E6 follows A2’s Date format, not a pattern you typed. If someone changes A2 to a Number format, E6 will start showing the serial too. TEXT does not have that surprise.

Do not format the formula cell and expect the serial inside the string to become a date. Format → Number → Date on C2 still shows Due 45418. The value is already text. Format the source cell, or wrap the source in TEXT / TO_TEXT, then join.

If you only need the date as a label, TEXT on the date is enough. If you also need to look the date up later, keep a real date column and join a helper column for display. Looking up a text 2024-05-06 against a date serial is dates stored as text.