Forum Discussion
DrExcel_Excel_MVP
Nov 19, 2023Copper Contributor
Insert a Blank Row After Every Change of Product
Insert a Blank Row After Every Change of Product let's do it step by step: Step by Step #1 =SEQUENCE(ROWS(B4:E13)) #2 =B4:B13=B5:B13 #3 =DROP(H4#,-1) Whic...
Lorenzo
Nov 19, 2023Silver Contributor
=LET(
TableRws, SEQUENCE(ROWS(Table)),
NewProd, IF(Table[Product] <> INDEX(Table[#All],TableRws,1), SEQUENCE(ROWS(Table),,0)),
Order, SORT( VSTACK(TableRws, FILTER(NewProd,NewProd)+0.1) ),
VSTACK(Table[#Headers], IF(MOD(Order,1),"",CHOOSEROWS(Table,Order)))
)
- djclementsNov 19, 2023Silver Contributor
Lorenzo and DrExcel_Excel_MVP Good ones! Just for fun, here's a couple more:
=LET( rng, A2:D11, v, TAKE(rng,, 1), r, ROWS(rng), s, SEQUENCE(r), n, FILTER(s, IFNA(v <> DROP(v, 1), 0)), SORTBY(EXPAND(rng, r + ROWS(n),, ""), VSTACK(s, n)) )
- OR -
=LET( rng, A2:D11, v, TAKE(rng,, 1), s, SEQUENCE(ROWS(rng)), DROP(SORT(IFNA(HSTACK(VSTACK(s, FILTER(s, IFNA(v <> DROP(v, 1), 0))), rng), "")),, 1) )
- DrExcel_Excel_MVPNov 20, 2023Copper Contributormany thanks for your contribution