Convert SOQL Date/Time Field to Excel Date/Time

Quick tip: convert Salesforce SOQL Date/Time strings (e.g., 2024-08-14T14:48:05.000+0000) into Excel-recognized date/time values using a simple formula and cell formatting.

Problem

When you export SOQL results (for example: SELECT Id, CreatedDate FROM Account), Salesforce Date/Time fields are returned in ISO format like 2024-08-14T14:48:05.000+0000. Excel doesn’t automatically recognize that as a datetime value.

Solution

Use a small formula to remove the time zone suffix and the “T” separator, convert the text to a numeric datetime value, then apply an Excel datetime format.

Steps

  • Assume your SOQL Date/Time string is in cell A2.
  • In the target cell (for example B2) enter the formula:
=VALUE(SUBSTITUTE(LEFT(A2, 19), "T", " "))
  • This takes the leftmost 19 characters (YYYY-MM-DDThh:mm:ss), replaces the “T” with a space, and converts the result to an Excel serial datetime.
  • Format the cell (Ctrl+1) → Custom → type: yyyy-mm-dd hh:mm:ss to display the value as a readable date/time.
  • Copy the formula down the column for other rows as needed.

Notes & Variations

  • If your exported timestamp has different precision, confirm the LENGTH and adjust the LEFT(…) length accordingly.
  • If you need to convert to local time from UTC, wrap with a time offset: =VALUE(SUBSTITUTE(LEFT(A2,19),"T"," ")) + (TIME(hours,minutes,0)) or add/subtract fractional days (e.g., + 5/24 for +5 hours).

Why this matters

Converting SOQL Date/Time fields into Excel datetime values makes it easy to sort, filter, calculate durations, and create charts — all essential for reporting and analysis outside Salesforce.

Use cases include ad-hoc exports for stakeholders, cross-system reconciliations, or offline analytics where Excel is the tool of choice.

Best practices

  • Keep a copy of the original raw export column for auditability.
  • Validate a few rows after conversion to ensure time zone handling is correct for your needs.

For Salesforce admins, developers, and business analysts, this tiny formula saves time and avoids manual parsing mistakes when preparing exported datasets for downstream analysis.