To get just the date from a datetime stamp in Excel, the fastest way is to use the INT function: =INT(A1), then format the cell as a Date. This works because Excel stores dates as whole numbers and times as decimals; the INT function strips the decimal (the time), leaving only the whole number (the date).
Excel handles date and time data in a unique way that often confuses new users. Every date is actually a serial number representing the number of days since January 1, 1900. For example, January 1, 2024, is stored as 45292. Time is stored as a fraction of a day. Therefore, 12:00 PM is 0.5, and 6:00 PM is 0.75. When you have a datetime stamp (e.g., 45292.75), you have a combined value. To isolate the date, you must remove the fractional component. Depending on whether you want to change the actual data or just how it looks, there are several ways to achieve this.
What You'll Need
- A computer with Microsoft Excel installed (works across Windows, macOS, and Web versions).
- A dataset containing cells with datetime values (e.g., "2023-10-15 14:30:00").
- Basic knowledge of how to enter a formula into a cell.
Step-by-Step
There are four primary ways to extract a date. Choose the one that fits your goal: using a formula for dynamic data, formatting for visual changes, the Text-to-Columns tool for permanent splitting, or Flash Fill for quick patterns.
Method 1: Using the INT Function (Best for Data Analysis)
- Click on the empty cell where you want the date to appear (e.g., cell B1 if your datetime is in A1).
- Type the formula
=INT(A1)and press Enter. - The result will likely look like a random five-digit number (e.g., 45123). This is the raw serial number of the date.
- With the cell still selected, go to the Home tab on the ribbon.
- In the Number group, click the dropdown menu (which usually says "General") and select Short Date.
- Drag the fill handle (the small green square at the bottom-right of the cell) down to apply this to the rest of your column.
Method 2: Using Custom Cell Formatting (Visual Only)
- Select the range of cells containing the datetime stamps.
- Right-click the selected area and choose Format Cells... (or press Ctrl+1 on Windows / Cmd+1 on Mac).
- In the Number tab, select Date from the Category list on the left.
- Choose your preferred date format from the list on the right (e.g., 3/14/2012).
- Click OK.
- Note: The time is still there in the background; Excel is simply hiding it from view. If you use these cells in a calculation that requires precision, the time will still be factored in.
Method 3: Using Text-to-Columns (Permanent Split)
- Select the column containing your datetime stamps.
- Go to the Data tab on the ribbon and click Text to Columns.
- In the wizard, select Delimited and click Next.
- Check the box for Space as the delimiter (since a space usually separates the date from the time). Uncheck all other boxes. Click Next.
- In the Data Preview window, click the column containing the time and select Do not import column (skip) if you only want the date.
- Ensure the date column is set to Date (MDY or DMY depending on your region).
- Click Finish. Your datetime stamps are now permanently converted to dates.
Method 4: Using Flash Fill (The "Magic" Way)
- Create a new column next to your datetime data.
- In the first cell of the new column, manually type the date exactly as it appears in the first datetime cell (e.g., if A1 is "2023-05-01 10:00", type "2023-05-01").
- In the second cell, start typing the date from the second datetime cell.
- Excel should show a light grey "ghost" list of suggested dates for the rest of the column.
- Press Enter to accept the suggestions and fill the column.
- If the suggestions don't appear, select the first date you typed and press Ctrl+E (Windows) or go to Data > Flash Fill.
Common Mistakes
- Ignoring the Format: The most common mistake is using
=INT()and thinking the formula failed because it returned a number like 45100. Remember that Excel sees dates as numbers; you must change the cell format to "Date" to see it human-readably. - Using TEXT() for Math: Using
=TEXT(A1, "mm/dd/yyyy")converts the date into a text string. While it looks correct, you cannot use this result in date-based calculations (like adding 7 days) without converting it back. - Overwriting Original Data: When using Text-to-Columns, users often forget to insert a blank column to the right first. This can cause Excel to overwrite existing data in the adjacent column.
- Assuming All Datetimes are Numbers: Sometimes data imported from CSVs or web tools is stored as "Text" rather than a true Excel "Date/Time" value. In these cases, the INT function will return a #VALUE! error.
Tips
- Dynamic Updates: If your source datetime data changes frequently, stick with the
=INT()formula. This ensures the date column updates automatically without you having to re-run Text-to-Columns or Flash Fill. - Handling Text Dates: If your datetime is stored as text, use
=DATEVALUE(LEFT(A1, 10)). This takes the first 10 characters (the date part) and converts them into a real Excel date number. - Quick Selection: To quickly select an entire column of dates, click the column letter at the top or press Ctrl+Space while a cell in that column is selected.
- Regional Settings: Be mindful that date formats (MM/DD vs DD/MM) depend on your computer's regional settings. If you are sharing a sheet globally, use the Format Cells > Date > Locale setting to ensure consistency.
Troubleshooting
If your results aren't appearing as expected, try these steps in order:
- Check for #VALUE! Errors: This usually means your datetime is actually a text string. To fix this, select the column, go to the Data tab, select Text to Columns, click Next twice, and in the final step, select Date and the correct format (e.g., MDY). Click Finish to force Excel to recognize them as dates.
- Check for Unexpected Numbers: If you see a number like 44561, your formula worked, but your formatting is wrong. Go to Home > Number and change "General" to "Short Date".
- Flash Fill Not Working: Flash Fill requires a clear pattern. If your datetime stamps are inconsistent (some have times, some don't, some use different separators), Flash Fill may fail. Try providing 3 or 4 manual examples before pressing Ctrl+E.
- Incorrect Date Values: If the date is off by one day, check if your datetime stamps are in UTC and your system is in a different timezone. Excel does not automatically handle timezone conversions; you may need to add or subtract time (e.g.,
=INT(A1 + (5/24))to add 5 hours).
Frequently Asked Questions
Can I extract the date without using a formula?
Yes. You can use the Text-to-Columns feature in the Data tab or Flash Fill (Ctrl+E) to split the date and time into separate columns without writing any formulas.
Why does my date look like a 5-digit number?
Excel stores dates as the number of days since January 1, 1900. A number like 45000 is simply the internal representation of a date. Change the cell format to "Short Date" to see the calendar date.
Does the INT function remove the time entirely?
Yes. Because time is stored as a decimal fraction of a day, the INT (integer) function removes everything after the decimal point, effectively deleting the time data and leaving only the date.
What is the difference between formatting and using a formula?
Formatting only changes how the cell looks; the time is still there. Using a formula like =INT() actually removes the time data, which is necessary if you are grouping data by day in a Pivot Table.
How do I get the date from a datetime that is stored as text?
Use the formula =DATEVALUE(LEFT(A1, 10)). The LEFT function grabs the date portion of the text, and DATEVALUE converts that text into a number Excel recognizes as a date.
Can I use a Pivot Table to do this?
Yes. If you drag a datetime field into the Rows area of a Pivot Table, modern versions of Excel often automatically group the data by Year, Quarter, and Month, effectively extracting the date for you.