How to Make a Bar Chart in Excel with 2 Variables
Trying to compare two different sets of data on one bar chart in Excel can feel like a puzzle, but it’s actually one of the clearest ways to show relationships in your data. You don't need to create separate charts or cram everything into a confusing visualization. This guide will walk you through exactly how to create a bar chart in Excel using two variables, covering both clustered and stacked chart types for different kinds of analysis.
What is a Bar Chart with 2 Variables?
A bar chart with two variables displays two different sets of data across the same categories. Instead of a simple chart showing just one value per category (like total sales per month), this type adds a second layer of information (like a sales forecast vs. actual sales per month, or sales broken down by two different product lines).
This allows you to make direct comparisons and see relationships you might otherwise miss. There are two primary ways Excel visualizes this:
Clustered Bar Chart: This chart places bars for each variable side-by-side for every category. It's perfect for directly comparing the performance of two distinct items within the same category. For example, comparing the Q1 sales vs. Q2 sales for three different regions.
Stacked Bar Chart: This chart stacks the bars for each variable on top of one another to form a single, combined bar for each category. It’s ideal for showing how different parts contribute to a whole. You might use it to show revenue from online sales and in-store sales for each month to see the total revenue and the proportion of each channel.
Step 1: Get Your Data Ready
Before you click a single button in Excel, the most critical step is organizing your data. A bar chart can only be as clear as the table it's based on. Your data needs to be structured in a simple, grid-like format for Excel to understand it.
Let's say you're a marketing manager for a small e-commerce store and you want to compare your social media traffic from two different platforms - Facebook and Instagram - over the last six months.
Your table should look something like this:
Example Data Table:
Month | Facebook Traffic | Instagram Traffic |
January | 1,200 | 950 |
February | 1,350 | 1,100 |
March | 1,500 | 1,450 |
April | 1,420 | 1,600 |
May | 1,650 | 1,850 |
June | 1,800 | 2,100 |
A few key tips for data prep:
Clear Headers are Non-Negotiable: Make sure the top row of your data table has unambiguous labels (like "Month," "Facebook Traffic," "Instagram Traffic"). Excel will use these to automatically create the chart legend and axis labels.
No Gaps: Avoid empty rows or columns within your data table. A clean, contiguous block of data works best.
Keep It Tidy: Ensure all data is numerical where it should be. Remove any unexpected commas or text within your values that could cause an error.
Step 2: Create a Clustered Bar Chart in Excel
A clustered bar chart is best for making a direct side-by-side comparison. In our example, we want to see which platform, Facebook or Instagram, brought more traffic each month. A clustered chart will show this instantly.
Instructions:
Select Your Data: Click and drag your cursor to highlight the entire data range you want to visualize. In our example, this would be cells A1 through C7. Be sure to include the headers!
Navigate to the Insert Tab: Go to the main ribbon at the top of Excel and click on the Insert tab.
Choose the Chart Type: In the "Charts" section, find the icon for "Insert Column or Bar Chart." Click on it.
Select Clustered Bar: A dropdown menu will appear with various chart types. Under the "2-D Bar" (or "3-D Bar") section, find the one labeled "Clustered Bar." It's typically the first option. Click it.
Excel will instantly generate a clustered bar chart on your worksheet. You will see the months listed on the vertical (Y) axis. For each month, there will be two bars side-by-side - one color representing Facebook traffic and the other representing Instagram traffic - extending horizontally along the (X) axis. A legend will automatically be created to help you distinguish between the two.
Step 3: Create a Stacked Bar Chart in Excel
Now, let's say you're less interested in comparing the platforms against each other and more interested in seeing the total social media traffic each month and what portion came from each platform. This is where a stacked bar chart shines.
Instructions:
Select the Same Data: Just like before, highlight your data range (cells A1 to C7).
Go Back to the Insert Tab: Click Insert on the main ribbon.
Open the Chart Menu: Click the "Insert Column or Bar Chart" icon.
Select Stacked Bar: In the dropdown menu, under the "2-D Bar" section, choose the option labeled "Stacked Bar." You'll also see an option called "100% Stacked Bar" - this variation is useful if you want to emphasize the percentage contribution of each part rather than the total volume.
This time, Excel will generate a chart where for each month, there is a single, longer bar. Each bar is made up of two colored segments representing the traffic from Facebook and Instagram. The total length of the bar shows the total social media traffic, making it easy to see which months were strongest overall.
Step 4: Customizing Your Chart for Clarity and Professionalism
Creating the chart is only half the battle. A default Excel chart is a good start, but a few quick tweaks can make it much easier for your audience to understand and more visually appealing for a report or presentation.
When you click on your chart, two new tabs will appear on the ribbon: Chart Design and Format.
Effective Customization Tips:
Give Your Chart a Descriptive Title: The default "Chart Title" is generic. Double-click it and change it to something specific like "Monthly Website Traffic: Facebook vs. Instagram."
Add Axis Titles: Is it obvious what the numbers on the bottom axis mean? If not, click the chart, go to the Chart Design tab, click "Add Chart Element," select "Axis Titles," and add a "Primary Horizontal" title. You could label it "Number of Visitors."
Adjust Colors and Styles: The default blue and orange are fine, but you can change them. On the Chart Design tab, you can choose from various pre-made style templates. To change individual bar colors, right-click on one of the bars you want to change, select "Format Data Series," and use the "Fill" bucket icon to pick a new color.
Add Data Labels: Sometimes it's helpful to see the exact numbers without having to guess from the axis. On the Chart Design tab, go to "Add Chart Element" > "Data Labels" and choose a position (like "Center," "Inside End," or "Outside End"). This places the exact value from your table onto each bar.
Clean Up the Legend: Excel places the legend on the side by default. You can click and drag it to a better spot (like the top or bottom) or use the "Add Chart Element" > "Legend" menu to move it. If your bar colors are self-explanatory or you plan to explain them, you might even remove the legend altogether to save space.
Common Problems and How to Fix Them
Even with simple steps, things can sometimes go wrong. Here are a couple of common issues people face and how to troubleshoot them.
My Axes Are Swapped!
Sometimes, Excel will guess wrong about how you want your data oriented, putting your categories on the legend and your data series on the axis. This is a quick fix.
Solution: Click your chart, go to the Chart Design tab, and click the "Switch Row/Column" button. This will flip your data, almost always resolving the issue.
My Chart Looks Too Cluttered.
This often happens when you have too many categories or text labels are too long. A bar chart with 50 categories is rarely readable.
Solution: First, consider if a bar chart is the right choice. If your data is dense, aggregation might be better (e.g., showing quarterly data instead of monthly). You can also try resizing the chart to give it more space, adjusting font sizes, or rotating the axis labels through the "Format Axis" pane (right-click on an axis label to find it).
Final Thoughts
Creating a two-variable bar chart in Excel is an essential skill for anyone who needs to present comparative data clearly. Whether you use a clustered chart for side-by-side analysis or a stacked chart to show how components make up a whole, it boils down to structuring your data properly and using Excel's intuitive tools to bring it to life.
Of course, the manual process of exporting data from platforms like Shopify, Google Analytics, or Salesforce into Excel just to build these charts can be tedious, especially for recurring reports. We designed Graphed to remove this friction entirely. By connecting your tools directly, you can ask for the exact chart you need - like, "Create a bar chart comparing traffic from Facebook and Instagram for the last 6 months" - and get a real-time, interactive dashboard in seconds, not hours.