excelexcel-formula

How to convert a table containing values and frequency to a single list in Excel 2016?


I have a table with Value in column one Frequency in column two. The following is the beginning of my list: enter image description here

I would like to complete an operation that turns this into a single column with the number for each value corresponding to the frequency. In this example, the single column would be "-3, 1, 1, 7, 8, 9, 12, 13, 13, ..., 27, 27, 27, 27, 27, 27, 27, 27".

Thanks in advance!


Solution

  • In D2, formula copied down :

    =LOOKUP(ROW(A1),SUBTOTAL(9,OFFSET(B$1,,,ROW($1:$17)))+1,A$2:A$16)&""
    

    enter image description here