I have a Google spreadsheet with two sheets: 'Input Sheet' and 'Output Sheet'. I would like all rows in the 'Input Sheet' to be repeated and stored in the 'Output Sheet' based on a cell value in column H.
I got the repeater to work with the following formula (formula is in cell A2 of the 'Output Sheet'):
=ARRAYFORMULA(
VLOOKUP(
TRANSPOSE(SPLIT(QUERY(REPT(ROW('Input Sheet'!A2:A)&" ",'Input Sheet'!H2:H),,9^9)," ")),
{ROW('Input Sheet'!A2:A),'Input Sheet'!A2:I},
{1,2,3,4,5,6,7,8,9}+1,0
)
)
However, in the 'Output Sheet', the values in columns F and G are just repeated based on the 'Input Sheet'. I would like column F and G values to be exact 1 week apart. For ex: cell F2 should be 4/7/2024 and cell G2 should be 4/13/2024. Cell F3 should be 4/14/2024 and cell G3 should be 4/20/2024, and so on...
A little help on how I can accomplish this please. Thank you!
I have included the spreadsheet below:
https://docs.google.com/spreadsheets/d/14jxO12zW7SKe6e5TpmLA6nIdPjWP17XZtghGvWmgn1M/edit?usp=sharing
Including a visual for my current and desired results below:
> CURRENT:
Week (Start) | Week (End) | Weeks
Apr 7, 2024 | Apr 27, 2024 | 3 (row 1)
Apr 7, 2024 | Apr 27, 2024 | 3 (row 2)
Apr 7, 2024 | Apr 27, 2024 | 3 (row 3)
> DESIRED:
Week (Start) | Week (End) | Weeks
Apr 7, 2024 | Apr 13, 2024 | 3 (row 1)
Apr 14, 2024 | Apr 20, 2024 | 3 (row 2)
Apr 21, 2024 | Apr 27, 2024 | 3 (row 3)
=LET(rng,'Input Sheet'!A2:I,
arr,FILTER(rng,INDEX(rng,,1)<>""),
WRAPROWS(TOROW(BYROW(arr, LAMBDA(r, TOROW(
MAP(SEQUENCE(INDEX(r,,8)), LAMBDA(wk,
{CHOOSECOLS(r, SEQUENCE(4)), INDEX(r,,6)+7*(wk-1),
INDEX(r,,6)+7*wk-1, INDEX(r,,9)}))))),1),7))
arr
row by row into a LAMBDA that stores the current row in r
.wk
.wk
where:
r
,r
with wk-1
weeks addedwk
weeks added.r
arr
, but the number of columns for each row can vary by multiples of 7.