0

I am using Excel 2008 for Mac. I would like to have a cell generate a string based on the contents of the other cells on the same row.

For example, say I have the following table headers:

bob, weave, nip, tuck

And the next row (or could be any subsequent row) are multiplier numbers, for example:

2, 3, 1, 2

I would like the last cell on that row to generate a string based on the counts in each cell, the result would be:

"bob, bob, weave, weave, weave, nip, tuck, tuck"

1 Answer 1

1

With data like:

enter image description here

pick a cell and enter:

=REPT(A1 & ", ",A2) & REPT(B1 & ", ",B2) & REPT(C1 & ", ",C2) & REPT(D1 & ", ",D2)
2
  • This almost yields the requested output, except it will leave a dangling comma on the last item (yes I know, that sounds pretty picky). But it seems pretty complicated to put a conditional of some sort on inserting the comma. Jul 3, 2015 at 14:15
  • @Electro-Bunny The trailing comma can be removed by using the LEFT() function. Jul 3, 2015 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .