Unable to Convert the Date format to Required Date format

Required date format is dd-MM-yyyy

I have a different situation
Some time date is like Jan 2 2021 → there is a problem, string is not getting recognized due to 2 spaces after Jan
Jan 20 2021 → no problem here, string is getting recognized

Help to resolve this and create a date format to recognize the string in excel



Thank You

Hello @Rajesh.Attada01 ,

I believe you can use .trim to remove the extra spaces.
After this, it should work.


Thank you for taking your time to assist me.

Actually I resolved this.

  1. Took Substring of 11 characters Jan 2 2020
  2. Wrote if statement to find if 5 character is a whitespace
  3. if yes → following MMM d yyyy format
  4. if no → following MMM dd yyyy format
  5. This worked.
    Happy Face :slight_smile:
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.