Split Rows by Condition

tejapowerbi

New Member
Joined
Nov 30, 2018
Messages
19
Happy Friday Everyone,
I have a below scenarios where I want to split rows (not column) based on condition. If the Month column has <12 then only rows required but if it is 12 month then 2 Rows required,15 month then one row with 12 months and one row with 3 months and if it is 24 months then split two rows in 12 months and 36 months then split 3 rows in 12 months and so on..Can any provide any suggestion?

start
end
months
1/1/2014
1/1/2015
12
1/1/2014
1/1/2016
24
1/1/2014
1/1/2017
36
1/1/2014
1/1/2015
7
1/1/2014
1/3/2015
15

<tbody>
</tbody>

start
end
months
1/1/2014
1/1/2015
12
1/1/2014
1/1/2015
12
1/1/2014
1/1/2015
24
2/1/2015
31/1/2016
24
1/1/2014
1/1/2015
36
2/1/2015
1/1/2016
36
2/1/2016
31/1/2017
36
1/1/2014
1/1/2015
7
1/1/2014
1/1/2015
15
2/1/2015
1/3/2015
15

<tbody>
</tbody>
 
Hi Peter,
I just want to share a good news with you.
Finally your suggested code is in production and it is splits more than 900,000 rows successfully without a single error.
[FONT=q_serif]
Thank you so much for your great Help.


[/FONT]
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

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