Split of dates

Aberdham

Board Regular
Joined
Mar 8, 2018
Messages
163
Office Version
  1. 365
Platform
  1. Windows
Dear all,

I have an Excel sheet with description such as deposit period 16.04-16.05.2018

and I would like to make a split to fill in the respective column
start date : 16.04
ene date: 16.05.2018

Could any of you come up with a formula that could help me to split the Dates?

would be greatly appreciated !

Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
OK, I think I understand now. You were on the right track with IFERROR. Try these

Split Dates (4)

BCD
1Description:StartEnd
2Deposit period 16.04-16.05-2018_DSL55560116/04/201816/05/2018
3credit lease_16.04-16.05.2018_DSL55626216/04/201816/05/2018
4withdraw period 16.04-16.05.2018_DSL55698516/04/201816/05/2018
5credit purchase 16.04-16.05.2018_DSL54542116/04/201816/05/2018
6Deposit_April.2018_DSL454512
7withdraw of 18 days_DSL454541

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:299px;"><col style="width:97px;"><col style="width:82px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
C2=IFERROR(SUBSTITUTE(REPLACE(MID(B2,LEN(B2)-25,16),6,6,""),".","/")+0,"")
D2=IF(C2="","",SUBSTITUTE(MID(B2,LEN(B2)-19,10),".","/")+0)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Hi Peter,

Sorry to bother you again, recently I have received data that have changed their format, instead of
withdraw period 16.(0)4-16.(0)5.2018_DSL556985; they have changed to [FONT=Arial, Arial]withdraw period 16.4-16.5.2018_DSL556985[/FONT]
[FONT=Arial, Arial]the 0 are omitted, however I was able to extract by modifying the formula by
[/FONT]=IFERROR(DATE(MID(B2,FIND("-",B2)+6,4),MID(B2,FIND("-",B2)-1,1),MID(B2,FIND("-",B2)-4,2)),"")

what if the month is December, and the day is 5. how should I modify this?
also, how would I be able to modify the result in D2 to auto populate the results?

Thank you for your help !
 
Upvote 0
Try these
C2: =DATE(MID(B2,FIND("_",B2,FIND("-",B2))-4,4),SUBSTITUTE(MID(B2,FIND("-",B2)-2,2),".",""),MID(B2,FIND(".",B2)-2,2))
D2: =SUBSTITUTE(LEFT(SUBSTITUTE(REPLACE(B2,1,FIND("-",B2),""),"_",REPT(" ",10)),10),".","/")+0

I'm suspecting though that there will still be problems when a period spans 2 years. For example 16 December 2018 to 16 January 2019. What will the data look like then?
 
Upvote 0
Hi Peter,

Thank you for your Response. The formula in C2 works for certain entries, but not for the others such as

candi_cos_1.1-31.1.2018_DSL_XXXXXX
candi_cos_1.1-9.1.2018_DSL_XXXXXX

However, formula in D2 works perfectly even if C2 has #Value

could you please advise.

Thank you
 
Upvote 0
The formula in C2 works for certain entries, but not for the others such as

candi_cos_1.1-31.1.2018_DSL_XXXXXX
candi_cos_1.1-9.1.2018_DSL_XXXXXX
Yes, my oversight sorry. Try this adjustment.

C2: =DATE(MID(B2,FIND("_",B2,FIND("-",B2))-4,4),SUBSTITUTE(MID(B2,FIND("-",B2)-2,2),".",""),SUBSTITUTE(MID(B2,FIND(".",B2)-2,2),"_"," "))
 
Upvote 0
Hi Peter,

That works great! Thank you so much !

However, I am strugging with extracting the left part of it. the part which Prior the start date and end date.
=IFERROR(LEFT(B2;SEARCH("_ESN";B2)-18);"")
 
Upvote 0
Is this what you mean?

Excel Workbook
BCDE
1Description:StartEndLeft part
2Deposit period 16.04-16.05-2018_DSL55560116/04/201816/05/2018Deposit period
3credit lease_16.04-16.05.2018_DSL55626216/04/201816/05/2018credit lease_
4withdraw period 16.04-16.05.2018_DSL55698516/04/201816/05/2018withdraw period
5credit purchase 16.04-16.05.2018_DSL54542116/04/201816/05/2018credit purchase
6Deposit period 16.4-16.5-2018_DSL55560116/04/201816/05/2018Deposit period
7credit lease_16.4-16.5.2018_DSL55626216/04/201816/05/2018credit lease_
8withdraw period 16.11-16.12.2018_DSL55698516/11/201816/12/2018withdraw period
9credit purchase 16.04-16.05.2018_DSL54542116/04/201816/05/2018credit purchase
10candi_cos_1.1-31.1.2018_DSL_XXXXXX1/01/201831/01/2018candi_cos_
Split Dates (7)
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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