Split Date Formula

JPAvila

New Member
Joined
Sep 14, 2016
Messages
8
Hello,

I constantly work with product inventory and I would like to know how to split dates based on time periods (Calendar Years or Time Periods i.e. 4/1/16 - 3/31/17 or 10/1/16 - 9/30/17. Is there a formula I can use for this...

For Example I have the following product with time period availability of:

Product Start Date End Date
1660062 09/23/2017 07/31/2020


However,

If I were to split the dates by calendar year Jan - Dec, the results would be:

Product Start Date End Date
1660062 09/23/2017 12/31/2017
1660062 01/01/2018 12/31/2018
1660062 01/01/2019 12/31/2019
1660062 01/01/2020 07/31/2020


If I were to split the dates by periods April-2017 - March-2018, the results would be:

Product Start Date End Date
1660062 09/23/2017 03/31/2018
1660062 04/01/2018 03/31/2019
1660062 04/01/2019 03/31/2020
1660062 04/01/2020 07/31/2020


Please also keep in mind dates with 30, 31 or 28/29 days depending of leap year.

'I've been trying to figure out a solution and its driving me crazy. Please help. :confused::confused::confused:

Best,
JP
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
If you chose Oct-Sep with the same criteria as above, then how would you want it to look then?
 
Upvote 0
Hi CyrusTheVirus,

Product Start Date End Date
1660062 09/23/2017 07/31/2020

If I were to split the dates by periods Oct - Sep, the results would be:

Product Start Date End Date
1660062 09/23/2017 09/30/2017
1660062 10/01/2017 09/30/2018
1660062 10/01/2018 09/30/2019
1660062 10/01/2019 07/31/2020

JP
 
Upvote 0
Hi JP,

Sorry, i've been out of state this weekend. I should have some type of solution for you in the next couple days. Unless someone has a better idea (or some crazy formula), this will probably need to be accomplished by combining multiple formulas along with a good amount of reformatting your spreadsheet. Keep you posted.
 
Last edited:
Upvote 0
Hi JP,

This ended up being a bit more complex that I'd hoped. Unless someone has a better/more clever/more efficient way of doing this, or if someone has a macro to do this (which is probably possible, but not my thing), then i'm hoping that the below could help you out?

Note first that columns J through P are helper columns which could be hidden if necessary.

And a disclaimer... please test this out. It appears to be working correctly, but date logic can become confusing (at least for me it can), so please test out the below before implementing.

Just copy the formulas down, and if you have any questions about any of this, then just let me know.

Excel Workbook
ABCDEFG
1Found in ListProductStart DateEnd DatePeriod StartPeriod EndIs 12 Month Period?
2Yes16600629/23/20177/31/2020JanDecYes
3Yes166006310/23/20173/31/2022AprMarYes
Dates


Excel Workbook
IJKLMNOPQR
1ProductCountStart DateEnd DatePeriod StartPeriod EndStart IncrementsEnd IncrementsPeriod StartPeriod End
2166006219/23/20177/31/2020JanDec9/23/201712/31/20179/23/201712/31/2017
3166006229/23/20177/31/2020JanDec1/1/201812/31/20181/1/201812/31/2018
4166006239/23/20177/31/2020JanDec1/1/201912/31/20191/1/201912/31/2019
5166006249/23/20177/31/2020JanDec1/1/202012/31/20201/1/20207/31/2020
6166006259/23/20177/31/2020JanDec1/1/202112/31/2021
71660063110/23/20173/31/2022AprMar10/23/20173/31/201810/23/20173/31/2018
81660063210/23/20173/31/2022AprMar4/1/20183/31/20194/1/20183/31/2019
91660063310/23/20173/31/2022AprMar4/1/20193/31/20204/1/20193/31/2020
101660063410/23/20173/31/2022AprMar4/1/20203/31/20214/1/20203/31/2021
Dates
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,329
Messages
6,124,302
Members
449,150
Latest member
NyDarR

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