Forum Discussion
QW5314
Jul 29, 2024Copper Contributor
Duplicate rows in order without VBA
I need to duplicate rows (without VBA), based on a cell value (column C in the example below). I found the formula below and it works in duplicating the rows, but I need the rows in the original orde...
- Jul 29, 2024
QW5314 Try removing the SORT function, then set the optional [scan_by_column] argument of TOCOL to TRUE or 1:
=CHOOSEROWS(B3:C7, TOCOL(IFS(C3:C7>=SEQUENCE(, MAX(C3:C7)), SEQUENCE(ROWS(B3:B7))), 2, 1))I'm assuming the number of repeats specified in column C won't always be the same for each record, otherwise this formula might be a bit excessive. Cheers!
QW5314
Jul 29, 2024Copper Contributor
Thank you Sir!! Worked like a charm.
djclements
Jul 29, 2024Silver Contributor
You're welcome! 🙂