How to Concatenate Date and Time in Excel
In this article
To concatenate a date and time in Excel, use the formula =A1+B1 if you want a real combined date-time value, or =TEXT(A1,"m/d/yyyy")&" "&TEXT(B1,"h:mm AM/PM") if you want a text string that displays exactly as typed. The first method keeps the result usable in calculations; the second gives you full control over formatting. This guide walks through both, plus the formatting traps that make a correct formula look wrong.
What You'll Need
- Excel for Microsoft 365, Excel 2021, 2019, 2016, or Excel for Mac (the functions used here are available in all of them).
- A date in one cell (for example, A1) and a time in another (for example, B1).
- Basic familiarity with entering formulas and opening the Format Cells dialog (Ctrl+1 on Windows, Command+1 on Mac).
Step-by-Step
- Check that your date and time are real values, not text. Select the date cell and look at the alignment: numbers and dates align right by default, text aligns left. If either cell is left-aligned, Excel is storing it as text and arithmetic will fail. To convert, use
DATEVALUEorTIMEVALUE, or re-enter the value in a recognized format. You can also use the Text to Columns wizard (Data > Text to Columns) to force conversion. - Decide whether you need a real value or a text string. A real value (a serial number) can be sorted, filtered, and used in date math. A text string is for display only, such as a label or a report heading. Choose accordingly before writing the formula.
- For a real combined value, enter
=A1+B1in a new cell. Excel stores dates as whole numbers and times as fractions of a day, so adding them produces a single serial number that represents both. Press Enter. The result may initially show only the date or only a number; that is a formatting issue, not a calculation error. - Format the result to show both date and time. Select the result cell, press Ctrl+1 (Command+1 on Mac) to open Format Cells, go to the Number tab, choose Custom, and type a format code such as
m/d/yyyy h:mm AM/PMordd-mmm-yyyy hh:mm. Click OK. The cell now displays the combined date and time while remaining a true value. - For a text string, use TEXT to control the appearance. In a new cell, enter a formula like
=TEXT(A1,"m/d/yyyy")&" "&TEXT(B1,"h:mm AM/PM"). The ampersand joins the pieces, and the space in quotes separates date from time. Adjust the format codes to match your locale (for example,dd/mm/yyyyfor UK-style dates). - Copy the formula down if you have multiple rows. Drag the fill handle or double-click it. If your data is in an Excel Table, the formula will auto-fill new rows.
- Convert the text result to a value if needed later. If you used the TEXT method but now need to sort or calculate, copy the result cells, then use Paste Special > Values to replace the formulas with static text, and finally use DATEVALUE and TIMEVALUE to convert back to a serial number. Alternatively, keep a helper column with the
=A1+B1value for calculations. - Test with a known date and time. Enter a date like 1/15/2024 and a time like 9:30 AM, apply your formula, and verify the output reads 1/15/2024 9:30 AM. This confirms the format codes are correct for your region.
Common Mistakes
- Using & on date and time cells without TEXT. The formula
=A1&" "&B1returns the underlying serial numbers (for example, 45306 0.395833) instead of readable dates. Always wrap date and time cells in TEXT when concatenating as text. - Forgetting to format the result of
=A1+B1. Excel may show a number like 45306.39583 or only the date portion. The value is correct; the display is not. Apply a custom format. - Mixing text and real values. If one cell is text and the other is a number, addition may produce a #VALUE! error. Check alignment and convert text to values first.
- Using a format code that does not match your system's date order. For example,
m/d/yyyywill display month first even if your region expects day first. Usedd/mm/yyyyor a format that matches your locale. - Assuming the result will update automatically when the source changes. A text string built with TEXT is static; if you edit the source date, the text does not change. Use a real value if you need dynamic updates.
Tips
- Use
=A1+B1and format asm/d/yyyy h:mmfor a clean, sortable combined value that works in PivotTables and charts. - To insert a line break between date and time in a text string, use
CHAR(10)instead of a space, and enable Wrap Text on the cell. - If you need the combined value in a specific time zone, remember Excel stores no time zone information; you must adjust manually.
- Use the TEXT function's second argument with a format code that includes AM/PM to avoid 24-hour confusion, or use
hh:mmfor 24-hour display. - When sharing workbooks, keep a column with the real serial value so recipients in other locales see the correct date and time regardless of their system settings.
Troubleshooting
If your formula returns a #VALUE! error, one of the cells likely contains text that Excel cannot interpret as a date or time. Check for leading or trailing spaces, non-breaking spaces, or a format like "15-Jan-24" that may be ambiguous in some locales. Use =ISNUMBER(A1) to test whether a cell is a real date/time value; it returns TRUE for numbers and FALSE for text.
If the result shows only a date or only a time, the cell format is incomplete. Open Format Cells and apply a custom format that includes both date and time codes. If the result shows a series of hash marks (#####), the column is too narrow; widen it.
If the combined value is off by a day or shows an unexpected time, check that the time cell does not include a date component. A time entered as "9:30 AM" is stored as 0.395833; if it was pasted with a date, the addition will include that date. Use =INT(A1)+MOD(B1,1) to strip any date from the time cell before adding.
If you used TEXT and the output does not match your expected format, verify the format codes. For example, "mm" gives the month number, while "mmm" gives the abbreviated month name. On Mac, some format codes behave slightly differently; test with a sample value.
Frequently Asked Questions
Can I concatenate a date and time without using TEXT?
Yes, if you want a real value, use =A1+B1 and then format the cell to show both date and time. This keeps the result usable in calculations. If you need a text string, TEXT is required to control the display.
Why does my concatenated result show a number like 45306.395833?
That is Excel's serial number for the date and time. Dates are whole numbers (days since 1/1/1900) and times are fractions of a day. Apply a date/time format to the cell to display it readably.
How do I concatenate date and time with a line break?
Use =TEXT(A1,"m/d/yyyy")&CHAR(10)&TEXT(B1,"h:mm AM/PM") and turn on Wrap Text for the cell. On Windows, CHAR(10) inserts a line break; on Mac, you may need CHAR(13) depending on the version.
Can I combine date and time from separate columns into one cell for sorting?
Yes, use =A1+B1 to create a single serial value, then format it. This value sorts correctly because it is a number. Text strings do not sort chronologically.
What if my date or time is stored as text?
Convert it first. Use DATEVALUE for dates and TIMEVALUE for times, or re-enter the value in a recognized format. You can also use Text to Columns (Data > Text to Columns) to force conversion.
Does the TEXT function work the same in Excel for Mac?
Yes, the TEXT function and format codes are consistent across Windows and Mac, but the display of dates and times may vary by system locale. Test with a sample value and adjust the format code if needed.