How can I tell SharePoint "Export to Excel" to store a folder name as text rather than translate to a number in date format?

JP 20 Reputation points
2023-09-29T10:16:40.5566667+00:00

When exporting a list of files from SharePoint to Excel using the in-built function "Export to Excel", a folder named 2023-05-23 is stored numerically as a date (23/05/2023) in the Name field instead of text "2023-05-23" (as preferred).
This means that the full path (Path field & "/" & Name field) sorts incorrectly in Excel.
I am looking for a fix to the export method or a way of returning the folder name to text using the same format used in the directory name (I have no control over the original folder names or the way they may display date).

p.s. I cannot set up a manual datalink to SharePoint as the site seems to be secured, and editing the line in the .iqy "DisableDateRecognition=False" to "True" does not have the desired effect.

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | Excel | For business | Windows
{count} votes

Answer accepted by question author
  1. Emily Du-MSFT 51,946 Reputation points Microsoft External Staff
    2023-10-02T07:13:25.94+00:00

    The "Export to Excel" function is integrated by SharePoint, there is on option to change it.

    As a workaround, we can use formula to format data in the excel file.

    1.Click Name column -> Format Cells -> Date -> Choose "YYYY-MM-DD".

    1

    2.In the Full path column, use this formula: =E2&"/"&TEXT(A2,"YYYY-MM-DD").

    2


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.