Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Create Date Range From Two Dates

· 5 min read · Home Tech

In this article
  1. Formula
  2. Worked Example
  3. How to Choose the Right Date Format
  4. Common Mistakes and How to Avoid Them
  5. How to Create a Dynamic Date Range (e.g., Last 7 Days)
  6. Alternatives to the TEXT Function
  7. Frequently Asked Questions

You can create a date range in Excel from two dates by using a formula that concatenates the start and end dates into a single text string, such as =TEXT(A2,"mm/dd/yyyy")&" - "&TEXT(B2,"mm/dd/yyyy"). This returns a readable range like "01/15/2024 - 02/20/2024" in one cell, while the underlying dates remain separate for calculations. The approach works in all modern Excel versions, including Microsoft 365, Excel 2021, 2019, and older releases.

in start | Start date | - | 2024-01-15 | 0
in end | End date | - | 2024-02-20 | 0
out range | Date range | - | TEXT(start,"mm/dd/yyyy") & " - " & TEXT(end,"mm/dd/yyyy") | 0

Formula

The general formula to display a date range in a single cell is:

=TEXT(start_date, "format1") & " - " & TEXT(end_date, "format2")

  • start_date – the cell containing the beginning date (e.g., A2).
  • end_date – the cell containing the ending date (e.g., B2).
  • format1, format2 – date format codes like "mm/dd/yyyy", "dd-mmm-yyyy", or "yyyy-mm-dd". Both can be the same or different.

The TEXT function converts the date serial number into a text string using the format you specify. The ampersand (&) joins the pieces together, and the quoted dash with spaces adds the separator.

Worked Example

Using the default values from the calculator above:

  • Start date: 2024-01-15
  • End date: 2024-02-20

Applying the formula:

=TEXT(2024-01-15,"mm/dd/yyyy") & " - " & TEXT(2024-02-20,"mm/dd/yyyy")

Step by step:

  1. TEXT(2024-01-15,"mm/dd/yyyy") returns "01/15/2024".
  2. TEXT(2024-02-20,"mm/dd/yyyy") returns "02/20/2024".
  3. Concatenating with " - " gives "01/15/2024 - 02/20/2024".

The result is a single text string that looks like a date range. Note that this is not a real Excel date; it is text, so you cannot use it directly in date arithmetic.

How to Choose the Right Date Format

Excel’s TEXT function supports many format codes. The most common ones for date ranges are:

  • "mm/dd/yyyy" – US style, e.g., 01/15/2024
  • "dd/mm/yyyy" – UK/Australian style, e.g., 15/01/2024
  • "dd-mmm-yyyy" – e.g., 15-Jan-2024
  • "mmm d, yyyy" – e.g., Jan 15, 2024
  • "yyyy-mm-dd" – ISO style, e.g., 2024-01-15

Pick the format that matches your audience or report style. If you want the same format for both dates, use the same code twice. If you want a shorter range like "Jan 15 – Feb 20, 2024", you can use different formats for start and end: =TEXT(A2,"mmm d")&" – "&TEXT(B2,"mmm d, yyyy").

Common Mistakes and How to Avoid Them

One frequent error is forgetting that TEXT returns a text value, not a date. If you later try to sort or filter by that column, Excel treats it as text, so chronological order is lost. To preserve sortability, keep the original date columns and use the range text only for display.

Another mistake is using the wrong format code. Excel is case-sensitive for some codes: "mm" is month, "MM" is not recognized and may return the literal text. Also, "m" alone can be ambiguous—use "mm" for two-digit months and "mmm" for abbreviated month names.

When the start date is after the end date, the formula still produces a range, but it looks reversed (e.g., "02/20/2024 - 01/15/2024"). You can add an IF check to swap them automatically: =IF(A2>B2, TEXT(B2,"mm/dd/yyyy")&" - "&TEXT(A2,"mm/dd/yyyy"), TEXT(A2,"mm/dd/yyyy")&" - "&TEXT(B2,"mm/dd/yyyy")).

How to Create a Dynamic Date Range (e.g., Last 7 Days)

Sometimes you need a range that updates automatically, like "01/10/2024 - 01/17/2024" for the last 7 days. You can use TODAY() or NOW() as the end date and subtract days for the start:

=TEXT(TODAY()-6,"mm/dd/yyyy") & " - " & TEXT(TODAY(),"mm/dd/yyyy")

This recalculates every time the worksheet opens or changes. For a rolling month, replace 6 with 29 (or use EDATE for months). For a fixed range, just reference the cells as in the basic formula.

Alternatives to the TEXT Function

If you prefer not to use TEXT, you can format the cells individually and then use a simple concatenation. For example, format A2 and B2 as dates, then in C2 enter =A2 & " - " & B2. Excel will display the underlying date serial numbers (like 45241) unless you wrap them in TEXT. So the TEXT approach is the most reliable.

Another alternative is to use CONCATENATE or the CONCAT function (in newer versions): =CONCAT(TEXT(A2,"mm/dd/yyyy")," - ",TEXT(B2,"mm/dd/yyyy")). This works the same as the ampersand method.

For Excel 365, you could also use TEXTJOIN, but it is overkill for just two values.

Frequently Asked Questions

How do I create a date range that is a real date, not text?

You cannot have a single cell contain two dates as a real date value. A cell can hold only one date serial number. If you need to filter or calculate on the range, keep the start and end dates in separate columns and create the text range only for display.

Why does my formula show a number instead of a date?

If you use =A2 & " - " & B2 without TEXT, Excel converts the date serial numbers to their numeric values (e.g., 45241). Always wrap each date in TEXT with a format code to force the display as a date.

Can I use this formula for date ranges that span different years?

Yes. The TEXT function works with any valid Excel date, regardless of year. Just make sure your format includes the year (e.g., "mm/dd/yyyy") if you want it shown.

How do I add a time range like "9:00 AM - 5:00 PM"?

Use the same pattern but with time format codes: =TEXT(A2,"h:mm AM/PM") & " - " & TEXT(B2,"h:mm AM/PM"). If the dates include times, you can combine both: =TEXT(A2,"mm/dd/yyyy h:mm AM/PM") & " - " & TEXT(B2,"mm/dd/yyyy h:mm AM/PM").

What if I want the range to show "Jan 15 to Feb 20" without the year?

Use =TEXT(A2,"mmm d") & " to " & TEXT(B2,"mmm d"). If the range spans a year boundary, you may want to include the year on the end date: =TEXT(A2,"mmm d") & " to " & TEXT(B2,"mmm d, yyyy").