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.
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Marcílio_Lobão

Well-known Member
Joined
Oct 7, 2013
Messages
733
Platform
  1. Windows
cesar333, Good afternoon.

Which information shows you the month of reference?

I'm waiting your answer
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,711
Office Version
  1. 2010
Platform
  1. Windows
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:

Dave Patton

Well-known Member
Joined
Feb 15, 2002
Messages
4,570
Office Version
  1. 365
  2. 2010
Platform
  1. Windows

ADVERTISEMENT

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>G</th><th>H</th><th>I</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="color: #333333;;">184/28</td><td style="text-align: right;;">28-Dec-17</td><td style="text-align: right;;">184</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="color: #333333;;">184/2</td><td style="text-align: right;;">2-Dec-17</td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:1.2em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">3b</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">H2</th><td style="text-align:left">=DATE(<font color="Blue">YEAR(<font color="Red">TODAY(<font color="Green"></font>)</font>),MONTH(<font color="Red">TODAY(<font color="Green"></font>)</font>),--(<font color="Red">RIGHT(<font color="Green">SUBSTITUTE(<font color="Purple">G2,"/",0</font>),2</font>)</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">I2</th><td style="text-align:left">=LEFT(<font color="Blue">G2,3</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">H3</th><td style="text-align:left">=DATE(<font color="Blue">YEAR(<font color="Red">TODAY(<font color="Green"></font>)</font>),MONTH(<font color="Red">TODAY(<font color="Green"></font>)</font>),--(<font color="Red">RIGHT(<font color="Green">SUBSTITUTE(<font color="Purple">G3,"/",0</font>),2</font>)</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 

cesar333

New Member
Joined
Aug 18, 2016
Messages
9

ADVERTISEMENT

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
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,711
Office Version
  1. 2010
Platform
  1. Windows
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))
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,711
Office Version
  1. 2010
Platform
  1. Windows
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:

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,850
Members
414,342
Latest member
K Darrell Smith

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
Top