Map non-boolean vector with text vector in Excel

36 Views Asked by At
Variable Numbers Fixed Text Desired result
1 Fixed text1 Fixed text1
2 Fixed text2 Fixed text2
0 Fixed text3 Fixed text2
2 Fixed text4 Fixed text4
0 Fixed text5 Fixed text4

How do I produce a new row or column that maps text in Column text with Numbers column and results in respective number of Fixed text cells as in the Number column?

I looked at Map and Sequence functions, but struggle even to formulate how this operation could be called in Excel. Any keywords for search will be appreciated.

1

There are 1 best solutions below

0
user11222393 On
=LET(a,FILTER(A2:B6,A2:A6>0),b,TAKE(a,,1),c,TAKE(a,,-1),TEXTSPLIT(CONCAT(REPT(c&"|",b)),,"|"))

enter image description here

Answer is based on this https://stackoverflow.com/a/74571362 and this https://stackoverflow.com/a/74182137/11222393 . Just added FILTER to filter out 0 values.