A relative frequency bar graph displays the proportion or percentage of the total dataset that falls into specific categories, rather than just the raw count. To create one in Excel, you must first calculate the frequency of each category, divide those counts by the total number of observations to find the relative frequency, and then insert a Clustered Column chart using those calculated values.
What You'll Need
- Microsoft Excel installed on your computer.
- A dataset consisting of categorical data (e.g., survey responses, product types, or grades).
- A basic understanding of how to enter formulas in Excel.
Step-by-Step
- Organize Your Raw Data: Ensure your data is in a single column with a clear header (e.g., "Customer Feedback" in cell A1).
- Create a Summary Table: In a new area of the worksheet, list your unique categories in one column. For example, if your data contains "Satisfied," "Neutral," and "Dissatisfied," list these in cells D2, D3, and D4.
- Calculate Absolute Frequency: Use the
COUNTIFfunction to count how many times each category appears. In the cell next to your first category (E2), enter:=COUNTIF(A:A, D2). Press Enter and drag the fill handle down to apply this to all categories. - Find the Total Sample Size: Sum all the frequencies to get the total number of observations. In the cell below your last frequency count, use the formula
=SUM(E2:E4). Note this total value. - Calculate Relative Frequency: In the next column (F), divide each category's frequency by the total sample size. In cell F2, enter:
=E2/$E$5(assuming E5 is the cell containing your total sum). The dollar signs create an absolute reference, ensuring the total doesn't shift when you drag the formula. - Format as Percentages: Highlight the relative frequency values in column F. Go to the Home tab and click the % (Percent Style) button in the Number group.
- Select Data for the Graph: Hold the Ctrl key (Cmd on Mac) and select the column of categories (D2:D4) and the column of relative frequencies (F2:F4). Do not include the "Total" row in your selection.
- Insert the Bar Graph: Go to the Insert tab. In the Charts group, click the Insert Column or Bar Chart icon and select Clustered Column (the first option under 2-D Column).
- Label Your Axes: Click the chart, then click the Chart Elements button (the plus sign icon) on the top right of the chart. Check the Axis Titles box. Click the titles on the chart to rename the X-axis (Categories) and the Y-axis (Relative Frequency or Percentage).
- Add a Chart Title: Click the default "Chart Title" text and type a descriptive name, such as "Relative Frequency of Customer Feedback."
Common Mistakes
- Using Absolute Frequency Instead of Relative: A common error is graphing the raw counts (frequency) instead of the proportions. If your Y-axis shows whole numbers like 50, 100, and 200 instead of 0.1, 0.2, or 10%, you have graphed the absolute frequency.
- Including the Total in the Chart: If you include the "Total" sum in your data selection, the graph will show a massive bar at 100% (or the total count), which compresses all other bars and makes the visualization useless.
- Forgetting Absolute References: When calculating relative frequency, failing to use the
$symbols (e.g., usingE5instead of$E$5) causes Excel to shift the divisor down as you drag the formula, resulting in incorrect percentages or#DIV/0!errors. - Incorrect Data Selection: Selecting the frequency column and the relative frequency column together can lead to a chart with two different scales, which is confusing to read. Only select the categories and the relative frequency.
Tips
- Sort Your Data: For a cleaner look, sort your summary table by relative frequency (Largest to Smallest) before creating the graph. This creates a "Pareto-style" effect where the most frequent categories appear first.
- Adjust Gap Width: To make the bars thicker, right-click any bar in the chart, select Format Data Series, and decrease the Gap Width percentage in the Series Options pane.
- Use Data Labels: If you want the exact percentage to appear above each bar, click the Chart Elements (+) button and check Data Labels.
- Dynamic Ranges: If you plan to add more data later, convert your raw data range into an official Excel Table (Ctrl + T). This allows your
COUNTIFformulas to update automatically.
Troubleshooting
- The bars are not appearing: Check your relative frequency column. If the numbers are formatted as text instead of numbers, Excel cannot graph them. Ensure no apostrophes are before the numbers and that the cells are set to "Number" or "Percentage."
- The X-axis labels are missing or wrong: This happens if Excel doesn't recognize the category column as labels. Right-click the chart, choose Select Data, and under the Horizontal (Category) Axis Labels section, click Edit. Select the range containing your category names.
- The Y-axis starts at a weird number: Right-click the Y-axis numbers, select Format Axis, and under Bounds, manually set the Minimum to 0.0 and the Maximum to 1.0 (for 100%).
- #DIV/0! Error: This occurs if your total sum cell is empty or zero. Ensure your
SUMformula is correctly calculating the total of your frequencies.
Frequently Asked Questions
What is the difference between frequency and relative frequency?
Frequency is the raw count of how many times a value occurs. Relative frequency is that count divided by the total number of observations, representing the proportion or percentage of the whole.
Can I make a relative frequency graph without a summary table?
While you can use PivotTables to automate the counting and percentage calculations, you still need a summarized set of data (either in a table or a PivotTable) because Excel's standard bar charts cannot calculate relative frequencies directly from raw, unaggregated lists.
Should I use a pie chart instead of a bar graph?
Pie charts are useful for showing parts of a whole for a small number of categories (2-5). However, bar graphs are superior when you have many categories or when you need to compare the relative frequencies of categories more precisely.
How do I change the bars to horizontal instead of vertical?
Right-click the chart, select Change Chart Type, and choose Bar instead of Column. This is often better if your category names are very long.
Why does my relative frequency sum to 99.9% instead of 100%?
This is usually due to rounding. Excel stores the precise decimal, but the "Percent Style" formatting rounds the display. The underlying data is still accurate.