How to Extract Date From A Date And Time in Excel

Learn multiple Excel methods to extract the calendar date from a combined date-time value with step-by-step examples, business use-cases, and expert tips.

excelformulaspreadsheettutorial
12 min read • Last updated: 7/2/2025

How to Extract Date From A Date And Time in Excel

Why This Task Matters in Excel

When you import data from databases, ERP systems, web forms, or time-tracking applications, the timestamps usually arrive in a single “date-time” field—e.g. 2023-07-15 14:32:08. While the time portion is essential for certain analyses (for example, calculating service response times), many reports, dashboards, and pivot tables need only the calendar date. If you do not strip the time, identical dates are treated as unique values, leading to bloated pivot tables, inaccurate counts, and visually confusing charts.

Consider a sales report exported from an e-commerce platform. Each transaction is recorded down to the second. Management, however, wants a daily revenue summary. Unless you reliably extract the date portion, your summary table may aggregate hundreds of unique timestamp keys that all represent the same day, causing formulas like SUMIF or VLOOKUP to miss matches.

In manufacturing, the production line may capture machine downtimes with timestamps. To identify days with excessive downtime, analysts first need to collapse the datetime into a pure date. Financial analysts face a similar challenge when consolidating bank records or Bloomberg downloads, which often include settlement dates with microsecond precision. Human-resources departments log badge-entry data with times, yet the compliance team may only need the date to calculate total days present.

Excel excels (pun intended) at quick reshaping of such data because it stores dates and times as serial numbers—the integer part represents days since 0-Jan-1900 (Windows) and the fractional part represents the time. With the right formula, you can surgically remove the fractional part without harming the original value. Mastering this small skill prevents downstream errors, keeps data models lightweight, and ensures every pivot cache or Power BI import behaves as intended. Moreover, understanding how Excel encodes dates lays the foundation for more advanced topics such as KPI period comparisons, rolling averages, and custom calendar calculations.

Failing to extract dates properly can cause query joins to fail, dashboards to misstate figures, and finance reports to misalign with fiscal calendars—problems that are costly in both credibility and time. Therefore, learning to separate date and time is an essential building block in every analyst’s toolbox.

Best Excel Approach

The fastest, most robust way to extract the date from a datetime value in Excel is to remove the fractional time component while retaining the underlying serial number’s integer part. Two native functions accomplish this elegantly:

  1. INT() — rounds a number down to the nearest integer. Because times are positive fractions, =INT(datetime) keeps the date and discards the time.
  2. TODAY() / DATEVALUE() in combination with TEXT() — useful when the datetime arrives as text instead of a true numeric timestamp.

For most numeric datetimes (the common case when you pull from databases or CSV exports), INT is both concise and performant.

Syntax:

=INT(A2)

Where A2 holds a numeric datetime such as 45123.60417 (which displays as 2013-07-15 14:30 after formatting).

Why INT is best:

  • Zero dependencies—works in every Excel version (desktop, web, Mac, Windows, 365).
  • Handles negative time correctly when working with 1904 date system on Mac if the value is positive.
  • Does not alter the cell’s underlying number format, giving you full control of display formatting later.

Alternative (numeric):

=TRUNC(A2,0)

TRUNC provides the same result but allows optional precision; specifying 0 decimals emulates INT. Performance is similar.

Alternative (text datetime):

=DATEVALUE(A2)

Only works if A2 is a text string that Excel recognizes as a date. Convert ambiguous locale formats via TEXT or SUBSTITUTE before calling DATEVALUE.

Parameters and Inputs

  • Datetime cell (required): A2 in our examples. Must be either a numeric serial or a text string that can be converted.
  • Number_format (optional but recommended): After the formula, format result as Date to display 2023-07-15 rather than 45123.
  • Locale considerations: If the source data is a text timestamp like \"15/07/2023 14:32\", ensure the system’s regional settings interpret day-month order correctly. Otherwise, standardize with TEXT or VALUE.
  • Error handling: Use IFERROR or LET to trap invalid strings.
=IFERROR(INT(A2),"Invalid timestamp")
  • Array inputs: With dynamic arrays (Excel 365) you can reference an entire column, e.g., =INT(B2:B1000); the spill range automatically fills.

Edge cases: blank cells return 0; negative datetimes (rare) throw off INT; adjust by wrapping ABS if needed for custom calendars; dates prior to 1-Jan-1900 not representable in Windows date system.

Step-by-Step Examples

Example 1: Basic Scenario

Imagine a sheet called [Orders] with raw export fields:

RowTimestampOrderID
22023-03-01 08:151045
32023-03-01 11:421046
42023-03-02 16:071047
  1. Confirm timestamps are numeric: Select [B2:B4], choose General format. You should see numbers like 44987.34375.
  2. In cell C2 enter:
=INT(B2)
  1. Copy or double-click the fill handle to populate down through C4. The column now shows 44987 in C2 and C3, 44988 in C4.
  2. With C2:C4 still selected, press Ctrl+1, choose Date > 14-Mar-2012 format style. C2 and C3 display 01-Mar-2023, C4 shows 02-Mar-2023.
  3. Rename column header to Dispatch Date.

Why it works: INT discards the fractional 0.34375 (representing 08:15) and returns the integer 44987 only, which Excel formats as 01-Mar-2023. Because INT is non-volatile, your workbook calculation stays fast.

Variations:

  • If you need both date and time split, add a companion column D2: =MOD(B2,1) and format as Time.
  • If datetime resides in text, use =DATEVALUE(LEFT(B2,10)) assuming ISO timestamp length.

Troubleshooting: If your INT formula returns the same value as the original, you likely typed it in a cell formatted as Date—Excel converts 44987 back into a date. Switch to General to inspect raw output.

Example 2: Real-World Application

Scenario: A call center exports agent logs with timestamps so HR can compute daily hours worked. The CSV file has [Agent], [Log-In], [Log-Out] columns, both in the form 2023-12-05 07:59:02.

Goal: Build a pivot table to show total hours per agent per day.

  1. Import the CSV into [Sheet1].
  2. Add helper column [Log-In Date] in E2:
=INT(C2)
  1. Add helper [Log-Out Date] in F2:
=INT(D2)
  1. Add column [Hours] in G2:
=(D2-C2)*24

Format as Number with 1 decimal.
5. Convert helper columns E and F to custom format dd-mmm-yyyy to emphasise the calendar day.
6. Select the table and insert a PivotTable. Drag [Agent] to Rows, [Log-In Date] to Columns, [Hours] to Values (Sum).
Outcome: The pivot groups hours correctly per day. Without extracting the date, each unique timestamp would create thousands of separate columns, making the report useless.

Business value: Management can quickly spot absenteeism or overtime by examining daily totals. The method remains robust even when the call log contains hundreds of thousands of records because INT is computationally light.

Integration note: After the pivot, you may connect to Power BI or SharePoint lists. The extracted date remains stable when you refresh, ensuring consistent visuals in downstream dashboards.

Performance tip: When dealing with large datasets, calculate helper columns once, then copy → Paste Values to freeze results before building pivots. This minimizes recalc time.

Example 3: Advanced Technique

Edge case: You receive a SQL dump where timestamps include milliseconds and are stored as text, e.g., \"2023-11-26 18:45:22.987\".

Objective: Extract the date, keeping data dynamic, and load into Power Query for transformations.

Steps:

  1. Load the CSV into Power Query (Data → Get Data → From Text/CSV).
  2. Power Query auto-detects the column as text because of milliseconds. Change Data Type: select the column, choose Date/Time. Power Query converts to true datetime.
  3. Add a new Custom Column named [OnlyDate] with formula:
= Date.From([Timestamp])

This transforms the datetime value by stripping the time.
4. Resulting column displays 26-Nov-2023.
5. Click Close & Load to push to Excel table.

Why use Power Query?

  • Handles mixed formats, milliseconds, or locale mismatches without manual formulas.
  • Streaming processing for million-row files, outperforming worksheet formulas.
  • Keeps transformations documented and refreshable.
    Professional tip: When exporting to the Data Model, create a Date table linked on the [OnlyDate] field to enable powerful DAX time-intelligence functions.

Back in the worksheet, advanced users can replicate similar behavior with a dynamic array:

=LET(
 raw, A2:A10000,
 dates, DATEVALUE(TEXT(raw,"yyyy-mm-dd")),
 dates
)

LET avoids recalculating TEXT multiple times and improves clarity. Wrap in IFERROR to manage blanks.

Edge-case handling: Some systems output Unix epoch seconds, not Excel serials. Convert using /86400 + DATE(1970,1,1) before applying INT.

Tips and Best Practices

  1. Always inspect the underlying value with General format before choosing a method; text strings require DATEVALUE, numeric values use INT.
  2. After extraction, apply Short Date or a custom format; the displayed date drives readability while the cell stores an integer, ideal for sorting.
  3. Prefer INT over TRUNC when working with positive datetimes—it is fractionally faster and clearer to readers.
  4. For large datasets, calculate in Power Query or write the INT formula over the entire column, then convert to static values to reduce volatile recalculation.
  5. Keep original datetime intact in a separate hidden column for audit purposes; never overwrite raw data—this supports traceability and avoids loss of precision.
  6. Use dynamic named ranges or Excel Tables so newly imported rows automatically inherit the date-extraction formula, keeping dashboards maintenance-free.

Common Mistakes to Avoid

  1. Formatting instead of extracting: Applying a Date format hides the time but does not remove it. Your pivot tables will still treat each timestamp as unique. Verify by inspecting with General format.
  2. Using TODAY() in place of INT: TODAY returns the current date, not the date portion of your timestamp. Mixing these up yields wildly inaccurate results.
  3. Forgetting to wrap DATEVALUE around text: If your timestamps are text and you use INT directly, you get a #VALUE! error. Ensure conversion first.
  4. Deleting the raw datetime: Overwriting the original column makes troubleshooting impossible. Keep a raw backup or use separate helper columns.
  5. Locale mismatch: European day-month order can silently flip when DATEVALUE interprets 04/05/2023. Use ISO 8601 (yyyy-mm-dd) or explicit TEXT reformatting to avoid off-by-month errors.

Alternative Methods

MethodFormula or ToolBest ForProsCons
INT()=INT(A2)Numeric datetimesFast, non-volatile, universalOnly works on numeric values
TRUNC()=TRUNC(A2,0)Numeric datetimes needing decimal controlExplicit precision argumentSlightly longer, same limits as INT
DATEVALUE()=DATEVALUE(A2)Textual datetimes recognisable by localeConverts text to date serialLocale-sensitive, errors on unrecognised strings
TEXT-to-ColumnsData → Text to ColumnsOne-off splitsNo formulas stored, easy wizardNot dynamic, re-run after refresh
Power QueryDate.From()Large datasets, ETL pipelinesRefreshable, handles complex formatsRequires loading queries; learning curve
VBA macroCDate or Int() loopAutomating legacy reportsFully automated; can update thousands of filesMaintenance, security settings, disabled macros

Use INT or TRUNC for quick, in-cell operations. Choose Power Query for enterprise-scale ETL or when timestamps include exotic patterns. TEXT-to-Columns is handy for ad-hoc fixes in smaller sheets.

FAQ

When should I use this approach?

Use INT (or TRUNC) whenever your datetime values are numeric and you need a dynamic, formula-based separation—especially before building pivot tables, summary dashboards, or lookup keys.

Can this work across multiple sheets?

Yes. Reference the source sheet explicitly, e.g., =INT('Raw Data'!B2). Convert the formula to a table column so that new rows on the Raw Data sheet automatically propagate to the Report sheet.

What are the limitations?

INT does not operate on text and cannot process negative serials from the 1904 system that are earlier than 0. DATEVALUE relies on your regional settings. Both fail on dates outside Excel’s supported range (before 1900 for Windows date system).

How do I handle errors?

Wrap formulas in IFERROR or use ISNUMBER to test inputs. For example:

=IFERROR(INT(A2),"Check timestamp")

In Power Query, set the data type to Date/Time; invalid rows will be flagged, allowing you to filter or replace errors.

Does this work in older Excel versions?

INT, TRUNC, and DATEVALUE exist since the earliest Windows releases, so Excel 2003 and newer are covered. Power Query is available in Excel 2010 (add-in) and native from 2016 onward. Dynamic arrays (spilled ranges) require Excel 365 or 2019.

What about performance with large datasets?

INT processes around five million cells per second on modern hardware. For tables exceeding 100,000 rows refreshed frequently, Power Query or VBA may be more performant because calculations occur once during load not every recalc. Disable workbook automatic calculation or convert formula results to values when the source data is static.

Conclusion

Extracting the date portion from a combined datetime is a deceptively simple action that unlocks cleaner summaries, accurate pivots, and robust data models. Whether you apply the lightning-fast INT function, the locale-aware DATEVALUE, or industrial Power Query transformations, mastering this technique keeps your datasets tidy and your analyses credible. Incorporate these skills into your standard data-prep workflow, experiment with the alternative methods outlined here, and you will avoid common pitfalls that trip up even veteran users. Now, try applying INT to your latest export and watch your dashboards instantly become clearer and faster!

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.