Solved - Calc - repeat a cell contents a specific number of times seperate rows

Thank you for your assistance. This is crossposted in openoffice forum. I have a table with sku# and quantity looks like

sku, qty
abc, 2
def, 3

I would like to turn it into this, the formula should repeat the sku in the next row based on the number in the qty column :
sku2
abc
abc
def
def
def

1 Like

You could sort the qty column.
Sorting is “available” in Calc and in Base.
.
Better: Upload a sample file for checking.
.
EDIT 1
Sorry, I misunderstood your question.
EDIT 2
Same question on https://forum.openoffice.org/en/forum/viewtopic.php?t=109199

ty, but sorting would not repeat the value in sku

EDIT
ty I have updated the post
This is crossposted in openoffice forum

Hallo
Calc:
Use Formula:

=REPT(A1 & UNICHAR(13) ; B1)

pull down as far you need and finally select the formula-range and choose: →Data→Text in Columns→→ok

2 Likes

In order not to pull the formula, I would suggest an option with an array formula
{=TEXTJOIN("";1;REPT(A2:A100&CHAR(10);B2:B100))}
(Yes, A2:B2 instead A1:B1 - first row is header qty and not number)

This should be similar to but simpler than requested in topic How to generate a list of custom cells that are variable in length and content .

You may check the solution I gave there and adapt it to your needs.

BTW: To turn your compact list into the expanded one would require custom code. You can, however keep the shortlist like a job descriptor and generate the expanded sequence of rtows.

ty, that worked perfectly
How to generate a list of custom cells that are variable in length and content .