I have rows with start and end date. I need to repeat each row N times and increment new date column by one. N = the number of days between the start date and en date
My table:
Column A | Start date | End date |
---|---|---|
A | 10/09/2022 | 12/09/2022 |
B | 15/09/2022 | 16/09/2022 |
C | 08/09/2022 | 12/09/2022 |
The result I'd like to generate automatically (new row will often be added):
Column A | Start date | End date | Date |
---|---|---|---|
A | 10/09/2022 | 12/09/2022 | 10/09/2022 |
A | 10/09/2022 | 12/09/2022 | 11/09/2022 |
A | 10/09/2022 | 12/09/2022 | 12/09/2022 |
B | 15/09/2022 | 16/09/2022 | 15/09/2022 |
B | 15/09/2022 | 16/09/2022 | 16/09/2022 |
C | 08/09/2022 | 12/09/2022 | 08/09/2022 |
C | 08/09/2022 | 12/09/2022 | 09/09/2022 |
C | 08/09/2022 | 12/09/2022 | 10/09/2022 |
C | 08/09/2022 | 12/09/2022 | 11/09/2022 |
C | 08/09/2022 | 12/09/2022 | 12/09/2022 |
I hope my need is clear.
Thanks,
I've tried THIS, but the solution is for fixed N times while I need N to be dynamic.
UPDATE
I though it'll be easy to reproduce the solution to my exact need, but it's not the case... I've received two great solutions which work with my first example, but not the full need.
Here is an example of the exact need:
Col1 | Col2 | Col3 | Col4 | Col5 | Col6 | Col7 | Col8 | Start date | End date | Col11 | Col12 | Col13 | Col14 | Col15 | Col16 | Col17 | Col18 | Col19 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | 10/09/2022 | 24/09/2022 | K | L | M | N | O | P | Q | R | S |
T | U | V | W | X | Y | Z | A | 05/10/2022 | 17/11/2022 | D | E | F | G | H | I | J | K | L |