问题
I have a column of numbers and a second column of numbers. The second column of numbers contains the frequency of the numbers in the left column.
I want to create a third column of numbers that has the raw data.
Example:
A  B
1  5
3  2
4  4
Column C would look like:
C
1
1
1
1
1
3
3
4
4
4
4
How can I do that in Excel? Thanks!
回答1:
Based on data in A1:B3, in C1, array formula**:
=IF(ROWS(A$1:A1)>SUM(B$1:B$3),"",INDEX(A$1:A$3,MATCH(TRUE,MMULT(0+(ROW(A$1:A$3)>=TRANSPOSE(ROW(A$1:A$3))),B$1:B$3)>=ROWS(A$1:A1),0)))
and copied down until you start to get blanks for the results.
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
来源:https://stackoverflow.com/questions/35039574/generate-column-of-raw-data-based-on-frequency-table-in-excel