1

input:

A 4
B 3
C 2

output:

A
A
A
A
B
B
B
C
C

Using only one formula. no code please.

Rubén
  • 34,714
  • 9
  • 70
  • 166
jason
  • 3,811
  • 18
  • 92
  • 147

1 Answers1

2

=ArrayFormula(IFERROR(TRANSPOSE(SPLIT(CONCATENATE(REPT(A:A&CHAR(9);B:B));CHAR(9)))))

AdamL
  • 23,691
  • 6
  • 68
  • 59
  • look likes the `REPT()` has a 100 limit – jason Jul 28 '13 at 02:56
  • 2
    That's correct, unfortunately. You can nest the REPT functions, such that something like this will cover up to 10,000 repetitions: `=ArrayFormula(IFERROR(TRANSPOSE(SPLIT(CONCATENATE(REPT(REPT(A:A&CHAR(9);INT(B:B/100));100)&REPT(A:A&CHAR(9);MOD(B:B;100)));CHAR(9)))))` – AdamL Jul 29 '13 at 00:03
  • Adam, I have a problem with the `Concatenate` function. http://stackoverflow.com/questions/22368544/new-google-spreadsheet-concatenate-limit-50000-characters-use-array-literal So I thought back to your answer here and how `REPT()` can be nested. Is there a way to nest `CONCATENATE()` also to get around the 50000 character limit? – jason Mar 15 '14 at 05:15