How to Auto Correct Syntax Error in Microsoft Excel like Date is entered in a column as 12.08.24, 12-08-2024, 12082024, 12.08.2024 and we want all the entries in a common format as 12.08.2024.

Vijay Singh 0 Reputation points
2024-08-12T10:30:27.8566667+00:00

How to Auto Correct Syntax Error in Microsoft Excel like Date is entered in a column as 12.08.24, 12-08-2024, 12082024, 12.08.2024 and we want all the entries in a common format as 12.08.2024.

Microsoft 365 and Office Excel For business Windows
Microsoft Copilot Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 33,071 Reputation points Volunteer Moderator
    2024-08-12T15:30:19.78+00:00

    I am assuming your dates are in Column A starting from A2 :

    
    =TEXT(
    
       IF(LEN(A2)=8, 
    
          DATE(MID(A2,5,4), MID(A2,3,2), LEFT(A2,2)), 
    
          IF(LEN(A2)=10, 
    
             DATEVALUE(SUBSTITUTE(A2,".","/")), 
    
             IF(LEN(A2)=9, 
    
                DATEVALUE(SUBSTITUTE(A2,"-","/")), 
    
                IF(LEN(A2)=6, 
    
                   DATE(2000+RIGHT(A2,2),MID(A2,4,2),LEFT(A2,2)), 
    
                   DATEVALUE(A2)
    
                )
    
             )
    
          )
    
       ), 
    
       "dd.mm.yyyy"
    
    )
    
    

    If you want the solution in ADF please tell me :)

    0 comments No comments

  2. Emi Zhang-MSFT 30,046 Reputation points Microsoft External Staff
    2024-08-19T02:52:28.31+00:00

    Hi,

    Just checking in to see if the information of Amira Bedhiafi was helpful. Please let us know if you would like further assistance.


    If the response is helpful, please click "Accept Answer" and upvote it.

    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 comments No comments

Your answer

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