Date format issue

coryh83

New Member
Joined
Jul 5, 2016
Messages
10
I know this should be simple but its throwing me for a loop.

I have a report that is sent to me that has a funky number for a due date. Example 1200721(7/21/2020). I need to convert this cell to a actual date format and be able to format it as a date. I also have another cell that will need to show how many days past the due date based on =Now()

Thanks for your help
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Is it always 7 digits? I mean syntax like: XYYMMDD? If yes it is easy to deal with.
 
Upvote 0
1200721(7/21/2020) what is the 1200 supposed to represent.
Could you post a few more examples?

The second example ignores the 1200 and assumes the current year hard coded.

T202007a.xlsm
BC
11200072121-Jul-20
21200072121-Jul-20
31200072121-Jul-20
2a
Cell Formulas
RangeFormula
C1C1=DATE(LEFT(B1,4)+820,MID(B1,5,2),RIGHT(B1,2))
C2C2=DATE(2020,MID(B2,5,2),RIGHT(B2,2))
C3C3=DATE(YEAR(TODAY()),MID(B3,5,2),RIGHT(B3,2))
 
Upvote 0
Thanks Mark
I made a wild guess that the month part is 2 characters 07; please edit if the month is just 1 character.

T202007a.xlsm
BC
2120072121-Jul-20
3120072121-Jul-20
4
2a
Cell Formulas
RangeFormula
C2C2=DATE(2020,MID(B2,4,2),RIGHT(B2,2))
C3C3=DATE(YEAR(TODAY()),MID(B3,4,2),RIGHT(B3,2))
 
Upvote 0
1200721(7/21/2020) what is the 1200 supposed to represent.
Could you post a few more examples?

The second example ignores the 1200 and assumes the current year hard coded.

T202007a.xlsm
BC
11200072121-Jul-20
21200072121-Jul-20
31200072121-Jul-20
2a
Cell Formulas
RangeFormula
C1C1=DATE(LEFT(B1,4)+820,MID(B1,5,2),RIGHT(B1,2))
C2C2=DATE(2020,MID(B2,5,2),RIGHT(B2,2))
C3C3=DATE(YEAR(TODAY()),MID(B3,5,2),RIGHT(B3,2))
thank you c1 works for me.
 
Upvote 0
@coryh83 If you have the date 21st December 2020 would it be 1201221?
If it is then I think you get the result in C1 below with that formula, whereas I think you need the result in C2

Both formulas Dave posted in post #5 would yield the correct result (Column E below).

Dates.xlsb
BCDE
1120122110/21/2022
2120122112/21/202012/21/2020
3120122112/21/2020
Sheet1
Cell Formulas
RangeFormula
C1C1=DATE(LEFT(B1,4)+820,MID(B1,5,2),RIGHT(B1,2))
C2C2=DATE(LEFT(B1,3)+1900,MID(B1,4,2),RIGHT(B1,2))
E2E2=DATE(2020,MID(B2,4,2),RIGHT(B2,2))
E3E3=DATE(YEAR(TODAY()),MID(B3,4,2),RIGHT(B3,2))
 
Last edited:
Upvote 0
I agree with Mark
Earlier post stated "Also the date may be clearer with the confirmation
Is it always 7 digits? I mean syntax like: XYYMMDD? If yes it is easy to deal with.
yes this is always the syntax"

To make up for previous post, you could try the latest suggestion.
Instead of showing the long number, I named it Num see Name Manager Num Refers to: =19000000

T202007a.xlsm
BC
1120072121-Jul-20
2120122121-Dec-20
3120122121-Dec-20
2a
Cell Formulas
RangeFormula
C1C1=DATE(LEFT(B1,3)+1900,MID(B1,4,2),RIGHT(B1,2))
C2C2=--TEXT(B2+19000000,"0000-00-00")
C3C3=--TEXT(B3+Num,"0000-00-00")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,676
Messages
6,126,168
Members
449,296
Latest member
tinneytwin

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