Excel Formula Date

tropics123

Board Regular
Joined
May 11, 2016
Messages
85
Hello, I'm hoping someone will have a good solution for this. Our client sends a list of dates and it either has seven or eight digits in column M, depending on the month. The format we want is MM/DD/YYYY.
The formula I have is: =LEFT(RIGHT(M2,8),2)&"/"&LEFT(RIGHT(M2,6),2)&"/"&RIGHT(M2,4)

However, the issue is when the month is a single digit such as May, then it throws off the formula. Please help!

Column MColumn N
Client's DateConvert Date
106202010/06/2020
1204201712/04/2017
1205201912/05/2019
501201750/01/2017
601200760/01/2007
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Assuming your Client's Date is in mddyy format then to get your required MM/DD/YYYY

Book1
MN
1Client's DateMM/DD/YYYY
2106202001/06/2020
31204201712/04/2017
41205201912/05/2019
5501201705/01/2017
6601200706/01/2007
Sheet4
Cell Formulas
RangeFormula
N2:N6N2=IF(LEN(M2)=7,"0"&LEFT(M2,1),LEFT(M2,2))&"/"&LEFT(RIGHT(M2,6),2)&"/"&RIGHT(M2,4)
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,900
Members
449,194
Latest member
JayEggleton

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top