Convert text date to start and end date

fernipascual

Board Regular
Joined
Sep 3, 2009
Messages
76
I would like to find an easy way to convert something like this (January 18 - February 2, 2019) stored in a single cell to start date and end date in separate cells. Here are a couple of examples:

January 18 - February 2, 2019
February 6 - 19, 2019

Thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Start date:

=--(LEFT(A1,FIND("-",A1)-2)&", "&RIGHT(A1,4))

End date:

=--IF(ISNUMBER(--MID(A1,FIND("-",A1)+2,1)),REPLACE(A1,FIND("-",A1)-4,4,""),REPLACE(A1,1,FIND("-",A1)+1,""))
 
Upvote 0
Start date:

=--(LEFT(A1,FIND("-",A1)-2)&", "&RIGHT(A1,4))

End date:

=--IF(ISNUMBER(--MID(A1,FIND("-",A1)+2,1)),REPLACE(A1,FIND("-",A1)-4,4,""),REPLACE(A1,1,FIND("-",A1)+1,""))

Thank you. This is great help!

It works on 90% of what I'm trying to convert. I am noticing the examples below that return an error. I suppose I could use find/replace as well as trim to make everything consistent before applying the formula.

January 1 - 17, 2019. (period)
January 1 - 17, 2019_ (blank space)
January 1 – 17, 2019 (Em hyphen)

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,449
Members
448,966
Latest member
DannyC96

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