Excel LAMBDA: Simple function to duplicate a row

Veröffentlicht am: 01 Juli 2023
auf dem Kanal: flexyourdata
496
37

You know when you're lying in bed, staring at the ceiling, and you think to yourself, "Self, I sure wish Excel had a function to duplicate a row of data an arbitrary number of times"?

Well worry no longer!

It all comes down to an array of ones.
=SEQUENCE(5,,,0)

Or if you prefer:
=EXPAND(1,5,,1)

Because CHOOSEROWS accepts an array of row indices, you can pass that array of ones and repeat the row:

=CHOOSEROWS(row, EXPAND(1,5,,1))
=CHOOSEROWS(row, {1,1,1,1,1})

But of course, you can and should make it into a LAMBDA function:

DUPLICATEROW
= LAMBDA(row, times, CHOOSEROWS(row, EXPAND(1,times,,1));

And while you're at it, you might need that "expand" thing somewhere else, so:
EXPANDVALUE
= LAMBDA(value, times, EXPAND(value, times,, value);

And then:
DUPLICATEROW
= LAMBDA(row, times, CHOOSEROWS(row, EXPANDVALUE(1,times) );

This is the tip of the iceberg of what you can do with LAMBDA in Excel.

#excel #lambda #exceltips #exceltricks #exceltutorial


Auf dieser Seite können Sie das Online-Video Excel LAMBDA: Simple function to duplicate a row mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer flexyourdata 01 Juli 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 496 Mal angesehen und es wurde von 37 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!