Generate Column of raw data based on frequency table in Excel

巧了我就是萌 提交于 2021-02-10 22:28:20

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!