搜尋此網誌

2025年4月22日 星期二

[Excel] Drawing Histograms with =FREQUENCY()

How to Create a Histogram in Excel with Two Sets of Data
  1. Suppose the grade of students are stored in A1:A70.
  2. Bin array (B1:B11) stores 9, 19, 29, ..., 99, 109.
    • Grades <= 9 falls into the first bin.
    • 10 <= grade <= 19 falls into the second bin.
    • The last bin is for 100 <= grade <= 109.  
  3. Create an array C1:C11 which is =B1-9.  This will be the x-axis for the bar chart.
  4. In D1, Enter the formula =FREQUENCY(A1:A70, B1:B11).
  5. You will get 12 cells.  The additional bin is for 109 < grade.  The value is certainly 0. You don't include this in the bar chart.
  6. Draw a bar chart with C1:D11.