Date Format

kumar0318

New Member
Joined
Mar 25, 2022
Messages
21
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hello, Could you please help me with formatting date from 20231215 to MM/DD/YYYY format?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
The format you have is numeric and Excel cannot recognize it as a date. You will have to use a formula to convert it. If your date is in A1:
Excel Formula:
=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))
Then use Format Cell to display as desired.
 
Upvote 0
Thank you, I have some dates in the correct format in the same collum, how do I keep them unchanged from above formula?
 
Upvote 0
Hard to say for certain without sample data. I think this:
Excel Formula:
=IF(A1<400000,A1,DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)))
 
Upvote 0
Thank you, I have some dates in the correct format in the same collum, how do I keep them unchanged from above formula?
As Jeff mentioned it is hard to advise without seeing the data.
Typically when some convert and some don't the ones that seem to have converted will have had their day and month reversed. (the day portion will have been < 13 allowing excel to put it in the month position)
You might want to check 1 or 2 of the ones that converted to see if that was the case.
 
Upvote 0
Here is the sample data from the column. As you can see, there are text, N/A and dates. I would like to convert the date which is in wrong format (20210112) and everything else remain as is in the formula.

Row Labels
20210112
N/A
Not Paid as of 1/6/2025
Offset
Paid in 2019
12/24/2020
1/7/2021
 
Upvote 0
Assuming all of your data are text. Maybe this.
Book1
AB
1Row labelsformatted m/d/yy
2202101121/12/21
3N/AN/A
4Not Paid as of 1/6/2025Not Paid as of 1/6/2025
5OffsetOffset
6Paid in 2019Paid in 2019
712/24/202012/24/20
81/7/20211/7/21
Sheet5
Cell Formulas
RangeFormula
B2:B8B2=LET(a,A2:A8,IF(ISERROR(--a),a,IF(ISNUMBER(SEARCH("/",a))*ISNUMBER(--a),--a,DATE(LEFT(a,4),MID(a,5,2),RIGHT(a,2)))))
Dynamic array formulas.
 
Upvote 0
This works, thank you! Just realized that I also have zeros in the same column as you can see second last cell from bottom. Can you please revise the formula to include this instance as well?


Clearing Date
N/AN/A
OffsetOffset
OffsetOffset
OffsetOffset
N/AN/A
OffsetOffset
OffsetOffset
OffsetOffset
OffsetOffset
N/AN/A
OffsetOffset
00000000#NUM!
202401091/9/2024
 
Upvote 0
Also when I ran with as is formula having my data in column A, it works fine but my actual column is Z so I replaced "a" and "A" with z and I got this result.

Clearing DateClearing date
N/A#SPILL!
Offset#SPILL!
Offset#SPILL!
Offset#SPILL!
N/A#SPILL!
 
Upvote 0
It's a spill formula so insert the first cell only, clear out things below. Adjust the range inside the formula don't copy down. Updated for '00000000' entries:
Rich (BB code):
=LET(a,A2:A8,IF(ISERROR(--a),a,IF(ISNUMBER(SEARCH("/",a))*ISNUMBER(--a),--a,IFERROR(DATE(LEFT(a,4),MID(a,5,2),RIGHT(a,2)),a))))

Book1
ABC
1Row labelsformatted m/d/yy
2202101121/12/21<-Insert formula here only
3N/AN/A
4Not Paid as of 1/6/2025Not Paid as of 1/6/2025
5OffsetOffset
60000000000000000
712/24/202012/24/20
81/7/20211/7/21
Sheet5
Cell Formulas
RangeFormula
B2:B8B2=LET(a,A2:A8,IF(ISERROR(--a),a,IF(ISNUMBER(SEARCH("/",a))*ISNUMBER(--a),--a,IFERROR(DATE(LEFT(a,4),MID(a,5,2),RIGHT(a,2)),a))))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,226,503
Messages
6,191,421
Members
453,657
Latest member
DukeJester

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