I am trying to execute the following in google sheets by repeating certain cell values from a range of name and how many it should be iterated , and resulted like this : cells (number of repetitions) and iterating it horizontally till the end of the row.
What i'm trying to do
IF i have a range like this :
Business Communication | 2
Business Intelligence & Data Analytics | 3
Communicative English | 1
Customer Relationship Management | 2
And resulting like this :
Business Communication
Business Communication
Business Intelligence & Data Analytics
Business Intelligence & Data Analytics
Business Intelligence & Data Analytics
Communicative English
Customer Relationship Management
Customer Relationship Management
I've tried some formula, from this thread
But i cant implemented it to my solution, i have thinking about arrayformula, but i'm not really sure that it can resolve my problem, Do you have any idea on how to achieve that using only native formula (no javascript)?
Try
=ARRAY_CONSTRAIN(arrayformula(query(flatten(split(rept("|"&A2:A,B2:B),"|")),"select * where Col1 is not null")),SUM(B2:B),1)
same result with
=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(QUERY( REPT(A2:A&"♥", B2:B), ,9^9), "♥"))))
4 steps
=arrayformula(rept("♥"&A2:A5,B2:B5))
you will get a list=arrayformula(split(rept("♥"&A2:A5,B2:B5),"♥"))
=arrayformula(flatten(arrayformula(split(rept("♥"&A2:A5,B2:B5),"♥"))))
=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(QUERY( REPT(A2:A&"♥", B2:B), ,9^9), "♥"))))
, the second one is more understandable =query(arrayformula(flatten(arrayformula(split(rept("♥"&A2:A5,B2:B5),"♥")))),"select * where Col1 is not null")