Excel Formulas to Concatenate Date and Time Stamps

📅 Jun 28, 2026 📝 Sarah Miller

Combining dates and times in Excel often results in a frustrating string of raw, unformatted serial numbers. When tracking project timelines or standard funding sources, merging these data points accurately is critical for clear reporting.

Implementing the right formula grants absolute clarity to stakeholders reviewing chronological data. However, the primary stipulation is that standard concatenation strips visual formatting; therefore, we must employ the TEXT function to define the output.

For instance, merging cell A2 (Date) and B2 (Time) requires: =TEXT(A2, "yyyy-mm-dd") & " " & TEXT(B2, "hh:mm:ss"). Below, we break down how to implement this formula seamlessly.

Excel Formulas to Concatenate Date and Time Stamps

Excel Formula to Concatenate Date with Time Stamp

When working with large datasets in Excel, you will frequently find dates stored in one column and timestamps stored in another. While this separation can sometimes be useful for sorting or filtering, there are many scenarios-such as preparing data for databases, system uploads, or timeline analysis-where you need to merge them into a single cell.

However, simply using the ampersand (& ) or the CONCATENATE function on a date and a time cell often produces unexpected, confusing results. Instead of a readable date and time, you might get something like 45123.58333.

In this comprehensive guide, we will explore why this happens and look at the best formulas and techniques to successfully concatenate a date with a timestamp in Excel, keeping your data both human-readable and functional.

The Secret of How Excel Stores Dates and Times

Before writing formulas, it is critical to understand how Microsoft Excel handles dates and times under the hood.

  • Dates are Integers: Excel stores dates as sequential serial numbers starting from January 1, 1900. For example, January 1, 1900, is stored as 1, and January 1, 2024, is stored as 45292.
  • Times are Decimals: Times are stored as fractional portions of a 24-hour day. For instance, 12:00 PM (noon) is half of a day, represented as 0.5. 6:00 AM is 0.25, and 6:00 PM is 0.75.

When you look at a cell containing 2024-01-01, Excel is actually reading 45292 and applying a visual formatting layer over it. If you try to concatenate a date cell (A2) and a time cell (B2) using a simple formula like =A2 & " " & B2, Excel strips away the formatting layers and merges the raw numbers, outputting something like 45292 0.5.

To avoid this, we must use specific techniques that preserve or rebuild the format we want.

Method 1: The Simple Addition Method (Recommended for Date-Time Math)

Because dates are whole numbers and times are decimals, the most efficient way to combine them is actually a simple mathematical addition. Adding them together creates a unified decimal number that Excel recognizes natively as a "Date-Time" value.

The Formula:

=A2 + B2

Assuming cell A2 contains the date and B2 contains the time stamp.

How to Format the Output:

When you first enter this formula, Excel might display the result as a raw decimal number (e.g., 45292.5). You must format the cell to display it correctly:

  1. Select the cell(s) containing the formula.
  2. Press Ctrl + 1 (Windows) or Cmd + 1 (Mac) to open the Format Cells dialog.
  3. Under the Category list, click on Custom.
  4. In the Type text box, enter your desired format. For example:
    yyyy-mm-dd hh:mm:ss or m/d/yyyy h:mm AM/PM
  5. Click OK.

Pros: This method keeps the data as a true numeric value. This means you can still sort the column chronologically, use it in PivotTables, or perform time-difference calculations (e.g., subtracting one timestamp from another).

Method 2: Using TEXT and the Ampersand (& ) Operator (For Text Outputs)

If you need the final concatenated date and time to be treated strictly as text (for instance, to merge it with other sentences, export it to a CSV with specific formatting, or avoid formatting issues on other computers), you should use the TEXT function.

The TEXT function converts a numeric value into a text string based on a formatting mask you specify.

The Formula:

=TEXT(A2, "yyyy-mm-dd") &
" " &
TEXT(B2, "hh:mm:ss")

How It Works:

  • TEXT(A2, "yyyy-mm-dd") converts the numeric date in A2 into a text string like "2024-01-01".
  • & " " & inserts a physical space between the date and the time.
  • TEXT(B2, "hh:mm:ss") converts the decimal time in B2 into a text string like "12:00:00".

Alternative Format Options:

You can customize the format masks inside the quotes to fit your regional requirements or personal preferences:

  • US Standard with AM/PM:
    =TEXT(A2, "mm/dd/yyyy") & " " & TEXT(B2, "h:mm AM/PM")
    Result: 01/01/2024 12:00 PM
  • Verbose Text Format:
    =TEXT(A2, "dddd, mmmm d, yyyy") & " at " & TEXT(B2, "hh:mm AM/PM")
    Result: Monday, January 1, 2024 at 12:00 PM

Method 3: Combining Text with Date and Time

Often, you need to embed a combined date and time stamp into a descriptive string, such as a log entry or report header. By utilizing the TEXT function, you can build clean phrases effortlessly.

The Formula:

="Report generated on " &
TEXT(A2, "mmmm d, yyyy") &
" at " &
TEXT(B2, "hh:mm AM/PM")

If A2 holds 2024-10-15 and B2 holds 14:30:00, the output of this formula will be:

Report generated on October 15, 2024 at 02:30 PM

Without the TEXT wrapper, this formula would have returned: "Report generated on 45580 at 0.604166666666667", which is useless to a reader.

Method 4: Using TEXTJOIN (Excel 2019 and Microsoft 365)

If you are working with modern versions of Excel, you can use the TEXTJOIN function. This function is incredibly useful when combining multiple cells with a consistent; a space or a comma).

The Formula:

=TEXTJOIN(" ", TRUE, TEXT(A2, "yyyy-mm-dd"), TEXT(B2, "hh:mm:ss"))

The first argument (" ") specifies the space delimiter, the second argument (TRUE) tells Excel to ignore empty cells, and the subsequent arguments are the values to join.

Comparison: Addition vs. TEXT Concatenation

Choosing between Method 1 (Addition) and Method 2/3 (TEXT formulas) depends entirely on how you plan to use the resulting data.

Feature Addition Method (A2 + B2) TEXT Method (TEXT(A2,...) & TEXT(B2,...))
Result Type Numeric (Date-Time Serial Number) Text string
Sortability Excellent (Filters chronologically: Oldest to Newest) Alphabetical (May sort "10/12/2023" before "2/05/2023")
Calculations Yes (Can calculate elapsed time easily) No (Requires conversion back to numbers first)
Formatting Dependency Depends on Excel cell formatting to look correct Hardcoded (Format remains correct even if exported)

Troubleshooting Common Errors

While merging dates and times is relatively simple, you might encounter a few common pitfalls. Here is how to fix them:

1. The Formula Returns a `#VALUE!` Error

This typically occurs when either the date cell or the time cell is not actually a number, but is already stored as a text string that Excel cannot interpret.

  • The Fix: Check if there are apostrophes before your dates/times (e.g., '2024-01-01). You can convert text dates to real dates using the DATEVALUE function, or text times to real times using the TIMEVALUE function.

2. Regional Formatting Issues (e.g., "yyyy" doesn't work)

If you are using a non-English version of Excel, the format codes inside the TEXT function must match your local language settings.

  • For example, in German, "Year" is "Jahr" and "Day" is "Tag". Thus, instead of "yyyy-mm-dd", you must write "jjjj-mm-tt".
  • In French, "Day" is "Jour", requiring "aaaa-mm-jj".

3. Leading Zeros Drop in the Hour

When displaying single-digit hours; 9:00 AM), you might want a leading zero (09:00 AM) to maintain structural consistency down your column.

  • Ensure you write "hh" (two h's) in your format mask instead of a single "h". "hh" forces Excel to display leading zeros.

Conclusion

Concatenating dates and times in Excel is a fundamental skill that bridges the gap between raw data storage and human-readable reporting. If you need to perform calculations or timeline analyses on your merged data, always stick to the Addition Method (=A2+B2). If you are building clean text displays, labels, or preparing exports for other software, leverage the flexibility of the TEXT function with the ampersand (&) operator.

By mastering these simple formatting rules, you ensure your spreadsheets remain clean, organized, and professional.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.