With formulas you can do it in a couple of steps.
Say your list is in A2:B4, then in C4 add a helper column to cumulatively sum the quantities:
copied down
Then in a new column to get the right number of results:
=IF(ROWS(A$2:A2)>$C$4,"",LEFT(INDEX($A$2:$A$4,MIN(IF(ROWS(A$2:A2)<=$C$2:$C$4,ROW($A$2:$A$4)-ROW($A$2)+1))),LEN(INDEX($A$2:$A$4,MIN(IF(ROWS(A$2:A2)<=$C$2:$C$4,ROW($A$2:$A$4)-ROW($A$2)+1))))-3))
confirmed with CTRL+SHIFT+ENTER not just ENTER and copy down
Then in an adjacent column and assuming you put the above starting in E2:
=E2&TEXT(COUNTIF(E$2:E2,E2),"000")
entered with ENTER and copy down to get final results.
Bookmarks