A tree map in Excel allows you to visualize hierarchical data using nested rectangles, where the size of each rectangle represents a quantitative value and the color often represents a category. This is achieved by selecting a structured data range and inserting a Treemap chart from the Insert tab. It is the most effective way to spot patterns, outliers, and the relative proportion of parts to a whole when dealing with multiple levels of categorization.

What You'll Need

  • Microsoft Excel (2016 or newer, as Treemaps were introduced in the 2016 version).
  • A dataset organized in a hierarchical structure (categories and subcategories).
  • Numerical values associated with the lowest level of your hierarchy.

Step-by-Step

  1. Organize Your Data: For a tree map to function, your data must be arranged in columns from the broadest category to the most specific. For example, if you are tracking sales, Column A should be the Region (North, South), Column B should be the Store (Store 1, Store 2), and Column C should be the Product (Widget A, Widget B). The final column must contain the numerical values (e.g., Total Sales). Ensure there are no empty rows or columns within the dataset.
  2. Clean the Labels: Check that your category names are concise. Because tree maps use rectangles to display data, long labels may be cut off or hidden if the rectangle is too small. Use abbreviations or short names for your categories to ensure the final chart remains readable.
  3. Select the Data Range: Click and drag your mouse to highlight the entire table, including the headers. Including the headers is critical because Excel uses these to label the legend and the chart elements.
  4. Insert the Treemap: Navigate to the Insert tab on the top ribbon. In the Charts group, look for the Hierarchy Chart icon (which looks like a small set of nested squares). Click the dropdown arrow and select Treemap. Note that depending on your version of Excel or screen resolution, the icons may be grouped slightly differently, but the category is always "Hierarchy."
  5. Verify the Hierarchy: Once the chart appears, Excel automatically groups the data. The largest rectangles represent the top-level categories, and the smaller rectangles nested inside them represent the subcategories. If the chart looks like a random collection of boxes, double-check that your data columns are sorted logically from general to specific.
  6. Format the Visuals: Right-click on any of the rectangles and select Format Data Series. In the pane that opens on the right, you can adjust the Overlap or change the Gap Width. While tree maps generally fill the entire space, adjusting these settings can help distinguish the boundaries between the primary categories.
  7. Customize Colors: To change the color scheme, go to the Chart Design tab. Click on Change Colors and select a palette that provides high contrast between different categories. This makes it easier for the viewer to distinguish between the primary groups at a glance.
  8. Add and Edit Labels: By default, Excel displays the category name. To add the actual values, you may need to manually add data labels or use a workaround such as adding the value to the category name in the original data cell (e.g., "Widget A - $500"), as standard tree maps in Excel do not always support dynamic value labels as easily as bar charts.

Common Mistakes

One of the most frequent errors is including a "Total" row at the bottom of the dataset. Because the tree map treats every row as a data point, it will create a massive rectangle for the Total, which will dwarf all other categories and make the rest of the chart nearly invisible. Always remove totals or subtotals before creating the chart.

Another common mistake is using non-numeric data in the value column. If the final column contains text, errors, or formulas that result in a "#VALUE!" error, the tree map will either fail to render or will omit those specific data points entirely. Ensure the value column is formatted as Number, Currency, or Accounting.

Users often attempt to use a tree map for data that isn't hierarchical. If you have a flat list of items with no parent-child relationship, a standard Pie Chart or Bar Chart is more appropriate. A tree map requires at least one level of categorization to be truly useful; otherwise, it is simply a series of boxes of different sizes.

Finally, avoid over-nesting. While Excel can handle multiple levels, having five or six levels of hierarchy usually results in rectangles that are too small to see or labels that are completely hidden. Stick to two or three levels for maximum clarity.

Tips

To make your tree map more professional, use a consistent naming convention. If one category is "North America" and another is "EU," the chart looks unbalanced. Use "North America" and "Europe" for consistency.

If you have a very large dataset, consider filtering the data first. A tree map with 200 small rectangles becomes a "confetti chart" where the visual impact is lost. Use a Filter or a Pivot Table to isolate the top 20-30 contributors before generating the map.

Combine the tree map with a Slicer. If you convert your data into an official Excel Table (Ctrl+T) before inserting the chart, you can add a Slicer from the Insert tab. This allows you to click a button to filter the tree map dynamically, which is excellent for presentations where you want to drill down into specific regions or time periods.

Experiment with the "Sunburst" chart if the tree map feels too rigid. The Sunburst chart is also found under the Hierarchy menu and displays the same data in concentric circles. It is often better for showing the proportion of the hierarchy, whereas the tree map is better for comparing the absolute size of the leaf nodes.

Troubleshooting

The chart is blank or shows an error: This usually happens if the value column contains non-numeric data or if there are merged cells in your data range. Unmerge all cells and ensure the value column contains only numbers. Restart the chart creation process after cleaning the data.

Categories are not grouping correctly: If "Store 1" appears in two different regions but is grouped as one, check for trailing spaces in your text. "Store 1" and "Store 1 " (with a space) are treated as different entities. Use the TRIM function in a helper column to remove excess spaces from your labels.

Labels are missing or cut off: This is a limitation of the tree map's space-filling algorithm. To fix this, try increasing the overall size of the chart area by dragging the corners of the chart box. If the labels are still missing, shorten the text in your source data table.

The chart is too slow to update: If you are linked to a massive external data source, the tree map may lag. Try copying the necessary data and using Paste Values to create a static table for the chart, which removes the overhead of calculating complex formulas in real-time.

Frequently Asked Questions

Can I change the colors of individual rectangles?

Yes, you can click once to select the whole series, then click a second time to select a specific rectangle. With that single box selected, go to the Format tab and change the Shape Fill color.

Does a tree map support negative values?

No, tree maps cannot display negative values because a rectangle cannot have a negative area. If your data contains negative numbers, Excel will either ignore them or produce an error.

How do I sort the rectangles in a tree map?

Excel automatically sorts tree maps from largest to smallest, starting from the top-left corner. You cannot manually drag and drop rectangles to change their order; the order is strictly determined by the numerical value.

Can I use a tree map with a Pivot Table?

Directly inserting a tree map from a Pivot Table is not supported in all versions of Excel. The best workaround is to create the Pivot Table, copy the resulting data, and paste it as values into a new range, then create the tree map from that range.

What is the difference between a Treemap and a Sunburst chart?

A Treemap uses nested rectangles to emphasize the size of the individual components, while a Sunburst uses concentric rings to emphasize the hierarchical relationship and the proportion of each level relative to the center.