Convert 2 digits into dates?

cesar333

New Member
Joined
Aug 18, 2016
Messages
9
Hey all,
I get several reports with information condensed into cells. When i copy it into my sheet all of the data is in one cell. I have created formulas to break the data up into different cells but one piece of data is just getting me stumped.

Cell I2 has 2 pieces of date formatted as "184/28". 184 is a flight number, 28 is the day of the month. 12/28/17". There are also flights for the following day "117/29"

I need to break up this data as follows G2=184/28 , H2=184, I2=12/28/17.

Any help with this would be appreciated.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
cesar333, Good afternoon.

Which information shows you the month of reference?

I'm waiting your answer
 
Upvote 0
Cell I2 has 2 pieces of date formatted as "184/28". 184 is a flight number, 28 is the day of the month. 12/28/17". There are also flights for the following day "117/29"

I need to break up this data as follows G2=184/28 , H2=184, I2=12/28/17.
You started by saying your data is in cell I2, then you end by saying the data is in cell G2... where is the data?

Is the number in front of the slash always going to be a 3-digit number?

Is the number after the slash always going to be a 2-digit number (leading 0 for days less than 10)?

Do we assume the current month is the month to use to form the date?
 
Last edited:
Upvote 0

Excel 2010
GHI
2184/2828-Dec-17184
3184/22-Dec-17
3b
Cell Formulas
RangeFormula
H2=DATE(YEAR(TODAY()),MONTH(TODAY()),--(RIGHT(SUBSTITUTE(G2,"/",0),2)))
H3=DATE(YEAR(TODAY()),MONTH(TODAY()),--(RIGHT(SUBSTITUTE(G3,"/",0),2)))
I2=LEFT(G2,3)
 
Upvote 0
Original data is in G2. The number in front of the dash ranges from a 1 digit number to a 4 digit number. That is the flight number. The number after the dash will either be a 1 digit number or a 2 digit. That is the day of the month. Some examples below.

-G-
32/28
20/28
164/28
198/29
292/29
118/29
 
Upvote 0
With your data starting in cell G2, put this formulas in the indicated cells and copy them down as needed...

H2: =REPLACE(G2,FIND("/",G2),3,"")

I2: =DATE(YEAR(NOW()),MONTH(NOW()),MID(G2,FIND("/",G2)+1,2))
 
Upvote 0
With your data starting in cell G2, put this formulas in the indicated cells and copy them down as needed...

H2: =REPLACE(G2,FIND("/",G2),3,"")

I2: =DATE(YEAR(NOW()),MONTH(NOW()),MID(G2,FIND("/",G2)+1,2))
This formula in cell I2 should also work and should be more efficient that the one I posted above...

=0+REPLACE(G2,1,FIND("/",G2),TEXT(NOW(),"mmmm"))

Note: This formula returns the date serial number so you will have to format the cell with the date format you want.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,185
Members
448,554
Latest member
Gleisner2

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