Fix Excel Date Formats and DATEDIF Errors from SharePoint
Question details
Correct imported SharePoint dates so Excel can display them properly and use them in DATEDIF calculations.

- Product
- Microsoft Excel, SharePoint, and Power Automate
- Device & OS
- not provided
- Scenario
- Dates are imported from SharePoint into Excel through a Power Automate flow and used in DATEDIF formulas.
- Observed behavior
- Imported dates have incorrect formats or cause DATEDIF to return #VALUE! errors.
Check the source date order, such as day/month/year or month/day/year, and identify the SharePoint site or OneDrive account connected to the flow. In Excel, left-aligned dates may be stored as text, although alignment alone is not conclusive.
Match SharePoint or OneDrive regional settings to the date format
Use this approach when the imported date order does not match the connected site's regional settings.
In SharePoint, open Site information > View all site settings > Regional Settings. For OneDrive for Business, open OneDrive Settings > More Settings > Regional settings. Menu names may vary.
Under Locale, select English (United Kingdom) if the dates use day/month/year order, then save the setting. If the source uses a different date order, choose a locale that matches it instead.
Run the Power Automate flow again and check the new values in Excel. Changing the locale may not convert text dates that were already imported.
In an empty Excel cell, enter =ISNUMBER(A2), replacing A2 with an imported date cell. If it returns TRUE, test a formula such as =DATEDIF(A2,B2,"d") using the start and end date cells.
Convert existing text dates in Excel
Use Excel's Text to Columns tool when dates already in the workbook are stored as text.
Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Excel format compatibility, making it easy to continue working with existing files. SharePoint and Power Automate regional settings must still be corrected in Microsoft services.

Frequently Asked Questions
Why does DATEDIF return #VALUE! for an imported date?
One or both date arguments may be text rather than Excel date values. Test each cell with =ISNUMBER(A2); FALSE indicates that it is not stored as a numeric date value.
Will changing the cell's date format convert text into a date?
No. Format Cells changes how a valid date is displayed but does not reliably convert text. Use Data > Text to Columns and select the source date order to convert suitable text dates.
Should I always select English (United Kingdom) in SharePoint?
No. English (United Kingdom) is appropriate when the relevant dates use day/month/year order. Choose regional settings that match the date format used by your source and flow.
Why does DATEDIF return #NUM! instead of #VALUE!?
DATEDIF can return #NUM! when the start date is later than the end date. Check the order of the date arguments and confirm that both dates were interpreted correctly.




