Insert flexible sequence of Months

Justerbox

New Member
Joined
Feb 20, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Dear all,

I would like to request some help on a excel problem.

I used the formula presented by Weaver here: Copy rows in excel multiple "n" times

It works perfectly, but now I want to add something to the multiplied rows.

I have a Invoice for a varying daterangerang (can be between 1 and 36 months)
InvoiceStart dateEnd DateNumber of months
300​
01.01.2021​
31.03.2021​
3​
500​
01.01.2021​
31.05.2021​
5​
200​
01.01.2021​
28.02.2021​
2​

Should turn to something Like this

InvoiceDate of InvoiceStart dateEnd DateNumber of months
300​
31.01.2021​
01.01.2021​
31.03.2021​
3​
300​
28.02.2021​
01.01.2021​
31.03.2021​
3​
300​
31.03.2021​
01.01.2021​
31.03.2021​
3​
500​
31.01.2021​
01.01.2021​
31.05.2021​
5​
500​
28.02.2021​
01.01.2021​
31.05.2021​
5​
500​
31.03.2021​
01.01.2021​
31.05.2021​
5​
500​
30.04.2021​
01.01.2021​
31.05.2021​
5​
500​
31.05.2021​
01.01.2021​
31.05.2021​
5​
200​
31.01.2021​
01.01.2021​
28.02.2021​
2​
200​
28.02.2021​
01.01.2021​
28.02.2021​
2​

I can provide my code that I have at the moment, but there is quite a mess going on to be honest, as I combined and recorded multiple macros.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try copying this formula into the top cell of your Date of Invoice column (assuming that would be cell B2) and then copy down:
Excel Formula:
=EOMONTH(EDATE(INDEX($C$2:$C$11,MATCH($A2,$A$2:$A$11,0)),COUNTIF(A$2:A2,A2)-1),0)
 
Upvote 0
Solution
Thank you very much KRice. I knew I was overthinking the Problem and there was a "simple" solution.
 
Upvote 0
I'm happy to help...and welcome to the board!
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,767
Members
449,049
Latest member
greyangel23

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