Contextures

Home > Formulas > Date > Split Date

Split Excel Date and Time

If a cell contains the combined date and time, use a formula to extract the date or time in separate columns. Or, split the date and time without formulas --use Excel's Flash Fill feature.

Note: For more examples of date and time functions, go to the Date Functions page.

time formula in named table

Split Date and Time Values

If you download data into Excel, one column might have a combined date and time value. In this short video, see how to quickly split that value into separate date and time columns.

The first example uses a simple formula, and the second example is done without a formula -- just a bit of typing.

The written instructions are below the video, and the Video Transcript is at the end of this page

Get Date Value With Formula

If a cell contains a combined date and time, you can extract just the date value, by using the INT function. Excel stores dates as numbers, with a decimal portion representing the time.

In the screen shot below, there is a combined date-time in cell B2.

In cell B3, the date has been formatted as a decimal number.

  • The integer in part of that number (42418) represents the date
  • The decimal portion (.50) is the time

if function checks for empty cell

INT Function for Date Value

The Excel INT function returns just the integer portion of that number, which represents the date.

In the next example, the complete date and time is in cell A2.

To get the date, enter the following formula in cell B2:  =INT(A2)

if function checks for empty cell

Formulas in Excel Table

If the data is in a named Excel table, the formula will use structured references with the field names. In the example below, the combined date/time is in the DateTime column.

Enter the following formula in the first row of the Date column (cell B2):

Date: : =INT([@DateTime])

The formula should automatically fill down to the last row in the table. After you enter the formulas, format those columns with your preferred Date and Time formats.

if function checks for empty cell

Get Time Value With Formula

If a cell contains a combined date and time, you can use the INT function to pull the time value into a separate column. Dates are stored as numbers in Excel, with the decimal portion representing the time.

There are 3 Time formulas below:

     1. Time - Hour, Minute, Second

     2. Time - Hour, Minute

     3. Time - Hour

1. Time - Hour, Minute, Second

To calculate the time value, subtract the date integer value from the combined date and time. The remaining decimal portion is the time.

In the example below, the combined date/time is in cell A2.

  • Enter the following formula in cell C2, to get the time with hour, minute and second:
    • =A2 - INT(A2)
  • Then, copy the formula down to the last row of data.

To format the times,

  • On the Home tab of the Excel Ribbon, click the drop down arrow for Number formatting
  • Click on the Time option

time formula and format

Time Formula in Excel Table

If the data is in a named Excel table, the Time formula will use structured references with the field names. In the example below, the combined date/time is in the DateTime column.

Enter the following formula in the first row of the Time column (cell C2):

Time: =[@DateTime]-INT([@DateTime])

The formula should automatically fill down to the last row in the table. After you enter the formulas, format those columns with your preferred Date and Time formats.

time formula in named table

2. Time - Hour, Minute

In some worksheets, you might want the time with hour and minute only, excluding the seconds.

Use this formula in cell D2, where the Date is in cell A2

  • =TIME(HOUR(A2),MINUTE(A2),0)

The TIME function has 3 arguments - 1-Hour, 2-Minute, 3-Second

  1. HOUR gets the hour from cell A2
  2. MINUTE gets the minute from A2.
  3. Zero is entered for the Second argument, instead of using the value in A2

To format the time for hour and minute:

  • On the Home tab of the Excel Ribbon, at the bottom right of the Number group, click the Dialog Box Launcher (or use the keyboard shortcut, Ctrl + 1 )
  • In the Format Cells dialog box, click the Time category
  • Click on the 1:30 PM format, then click OK

time formula and format

3. Time - Hour

If you just want to show the hour, you can show that value as a number, or as a time

Hour as Number

  • To get the hour as a number, use this formula: =HOUR(A2)
  • Format that result as a Number or as General, to just see the number in the cell.

Hour as Time

  • To get the hour as time, use this formula: =TIME(HOUR(A2),0,0)
  • Format that result as a Time, such as 13:30 or 1:30 PM

time formula and format

Get Date or Time Value - No Formula

If you're using Excel 2013 or later, you can use the Flash Fill feature to get the date or time in a separate column, without formulas.

NOTE: the dates and times entered with Flash Fill will NOT update automatically if the combined date/time cell changes -- these are static entries.

Here's how you can use Flash Fill for dates or times.

  • Type the first two dates in column B, based on the dates in column A.

if function checks for empty cell

  • Then, go to the Data tab on the Excel Ribbon, and click Flash Fill.

if function checks for empty cell

The rest of the dates should fill in, and you can use the Flash Fill options box to confirm or undo the changes.

if function checks for empty cell

Flash Fill Time Column

Next, follow these steps to fill in the Time column:

  • In column C, enter the first two times, based on the dates in column A
  • Next, go to the Data tab on the Excel Ribbon, and click Flash Fill.
  • The rest of the times should fill in, and you can use the Flash Fill options box to confirm or undo the changes.

Flash Fill Option Setting

If the Flash Fill command doesn't work, follow these steps, to change its Excel Options setting

  • At the top left of the Excel window, click the File tab
  • In the list at the left, click Options (near the bottom of the list).
  • In the Excel Options window, in the Category list, click Advanced
  • Then, in the Editing Options section, add a check mark to "Automatically Flash Fill"
  • Click the OK button, to close the Options window.

automatically flash fill

Get the Sample File

Get the sample Split Date and Time workbook. The zipped file is in xlsx format, and does not contain any macros.

More Tutorials

Date Functions

Printable Excel Calendar

WORKDAY.INTL function

Leap Year Calculations

Dates, Weekend

Excel Dates Fix Format

Nth Weekday in Month

Dates and Times FAQs

Video Transcript

Here is the transcript for the Split Date and Time video, at the top of this page.

How to Split Date and Time in Excel

If you have a file with dates and times in the same cell, we'll see two quick ways that you can separate that into date and time columns.

Split With Formulas

The first one will use a formula. So in here I'm going to click and type an equal sign.

We'll use the INT function, which is for an integer and that is going to pull the whole number from this cell, which is just the date part of the date and time.

When I press Enter we'll see a date. Now if you see a number, you can format that as a date.

Then I can select that cell, double-click on the Fill Handle, and I very quickly have all the dates.

Get the Time Value

If a date has a time attached to it, that's a decimal number.

So if it's 12 noon, it would be the date number 0.5.

So we want to just get that decimal portion, so we'll type equals the date. So that's the full member including the decimal.

And then minus the date portion, we want to subtract that full number.

So we'll use the INT bracket and click on the date. And when I press Enter, we get the time. And again, you might have to format that as time, if you're just seeing a number. And then fill that down.

Split Without Formulas

We can also pull this out without a formula. So here's another copy of the same list. And in here I'm going to just type the first two dates.

So I'll type 2/1/16 and 2/3/16.

And now we're going to use the Flash Fill. And if you're doing this with text, it would fill down automatically, usually, once we set a pattern, but for numbers or dates, it doesn't do that.

We can go to the Data tab, and click Flash Fill, and then it will suggest the rest of the dates for you.

And then you can come here and accept or undo or just leave it as is if you want to accept it.

Get the Time Value

And we can do the same thing for the time. So I'll type the first couple, and 9:32

And now again, I'll go and click Flash Fill, and it fills down the rest and they look fine to me. So I'll leave those as is.

Now those won't change if these dates change.

On the sheet where we used a formula, if we update a time or the date, because we have formulas here, those would update.

 

 

Last updated: June 12, 2023 9:07 AM