Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Insert Treemap: Step-by-Step Guide

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

A treemap in Excel is a chart that shows the relative size of categories as nested rectangles, so you can compare many values at once and instantly see which categories dominate. To insert one, arrange your data in two columns — a category column and a value column — select the whole range including headers, then go to Insert > Chart group > Treemap icon (it looks like a small grid of rectangles). Excel builds the chart immediately, and you can refine labels, colors and layout from the Chart Design and Format tabs. Treemaps are available in Excel for Microsoft 365, Excel for the web, and Excel 2019 and later; if you are on Excel 2016 or older, the chart type is not there and you will need a different approach such as a stacked bar or a sunburst-style manual layout.

What You'll Need

  • A version of Excel that supports treemaps: Excel for Microsoft 365, Excel for the web, or Excel 2019 or later. Excel 2016 and earlier do not include this chart type.
  • A data range with at least one text category column and one numeric value column. Ideally the values are positive numbers.
  • Clean data: no blank category rows inside the range, no merged cells, and no text in the value column.
  • Optional but useful: a third column of sub-categories if you want nested rectangles, and a fourth column of grouping labels if you want to compare several groups side by side.

Step-by-Step

  1. Lay out your data in a simple table. Put column headers in the first row. In the first column put the category names (for example product names, departments or regions) and in the next column put the numbers you want to compare (sales, spend, headcount). One row per category, with no subtotal or total rows mixed in, because totals will show up as a giant block that distorts the picture.
  2. Select the range including the headers. Click the first header cell, hold Shift, and click the last value cell. Make sure you are not including a heading like "Total" in the middle of the data.
  3. Go to the Insert tab. On the ribbon, find the Charts group. The exact look of the group differs slightly between Excel versions and platforms, so if a button is not where you expect, look for the small icon that opens a chart gallery instead.
  4. Click the Treemap icon. It sits in the second row of chart options and looks like a set of unequal rectangles. Hover over it and the tooltip will confirm it says Treemap. Click once and the chart is placed on the sheet.
  5. Check the chart is reading the right columns. If Excel guessed wrong — for example it treated the value column as a series name — go to Chart Design > Select Data and correct the Legend Entries (Series) and Horizontal (Category) Axis Labels. The category column belongs in the axis labels box, the number column in the series values box.
  6. Add or refine labels. Click the chart, then use the + button at the top right of the chart (Chart Elements) and tick Data Labels. With the labels selected you can choose to show category names, values, or both using More Options > Label Options. If labels are cut off, resize the chart or reduce the font size in the Home tab while the labels are selected.
  7. Decide whether you want nesting. To get sub-categories, add a third column to the data with the sub-category names and include it in the selection. Excel then stacks small rectangles inside the larger parent rectangles. The leftmost text column becomes the outer level.
  8. Pick a layout style. With the chart selected, go to Chart Design > Change Chart Type and choose the treemap variant that suits you. Excel offers treemap and sunburst in this family; treemap is the flat nested-rectangle view, sunburst arranges the same hierarchies in rings. Switch between them on the same data to see which reads better.
  9. Adjust colors and formatting. Use Chart Design > Change Colors to pick a palette, or right-click a single rectangle and choose Format Data Point to set its fill separately. This helps highlight the largest few categories without adding text.
  10. Give it a clear title. Click the chart title placeholder and type something descriptive, such as "Sales by product, this quarter". A treemap without a title is hard to interpret because the reader cannot tell what the numbers mean.

Common Mistakes

Including totals and subtotals. A grand total row becomes one enormous rectangle and squeezes everything else into slivers. Filter or delete total rows before charting.

Mixing text into the value column. Cells containing "n/a", dashes or spaces where numbers should be are read as text and either dropped or plotted as zero, which makes the layout misleading.

Using categories that are too small or too many. Dozens of tiny categories produce unreadable labels and meaningless speck-sized rectangles. Group minor items into an "Other" category first.

Expecting negative values to work. Treemaps compare area, and area cannot be negative. If your data contains negative numbers, those items will not display sensibly; use a column chart or a waterfall chart for values that go below zero.

Leaving gridlines and axes on. Treemaps have no traditional axis; turning off unnecessary chart elements keeps the visual clean. Use the + menu to remove anything that adds clutter.

Tips

Sort your source data from largest to smallest before charting. Excel places rectangles roughly in data order, and sorting makes the largest block land in a predictable corner and makes comparison easier.

Use a helper column that converts your numbers to percentages if you want the labels to show share of total, and point the data labels at that column. This is often more meaningful than raw totals.

Keep the chart on the same sheet as the data while you build it, then move it to its own sheet once it looks right. When the data range changes, edit the values and the chart updates automatically as long as the range still covers the new rows.

For presentations, increase the font size on data labels and remove the legend if every rectangle is already labeled. A treemap with both a legend and labels duplicates information.

Copy the chart into Word or PowerPoint with Ctrl+C and Ctrl+V; use Paste Special and choose Picture if you need it to stay fixed while the workbook changes behind it.

Troubleshooting

The Treemap icon is greyed out or missing. Check that your selected range contains at least one text column and one numeric column and that you have selected more than a single cell. Also confirm you are not editing a cell or inside a table filter state. If the icon is absent entirely, your Excel version predates treemap support.

The chart appears empty or shows only one block. Open Chart Design > Select Data and verify that the series values point to the number column, not to a header or an empty range. A common cause is selecting the header row only.

The rectangles are all the same size. This usually means the value column was read as text. Select those cells, check for leading apostrophes or spaces, and convert them to numbers — for example by using Data > Text to Columns and finishing without changing anything, or by multiplying by 1 in an empty cell.

Labels overlap or disappear. Make the chart bigger, reduce the label font, or use More Options > Label Options to show only the value instead of both name and value. Very small rectangles will not fit any label; that is expected.

Nesting does not appear. Nesting needs at least two text columns in the selected range. If you only selected one category column, Excel has nothing to nest.

The chart will not refresh after editing data. Confirm the new rows are inside the range referenced by the chart; use Select Data to extend the range, or convert your source to an Excel Table so the chart follows new rows automatically.

Frequently Asked Questions

Can I make a treemap in Excel 2016?

No. Treemaps were added in Excel 2019 and are included in Microsoft 365 and Excel for the web. In Excel 2016 you would need a different chart type or a manual shape-based layout.

Does a treemap work with negative numbers?

Not well. Rectangle area represents magnitude, so negative values have no sensible visual meaning and are usually excluded or ignored. Use a bar or column chart for data that includes negatives.

What is the difference between a treemap and a sunburst?

Both show hierarchy. A treemap uses nested rectangles and is better for comparing many categories; a sunburst uses concentric rings and is better for showing deep hierarchy levels. You can switch between them on the same data via Change Chart Type.

Can I show percentages instead of raw values?

Yes. Add a helper column that calculates each category's share of the total, then point the data labels at that column so each rectangle shows a percentage.

Will the chart update automatically when I change the numbers?

Yes, as long as the edited cells are inside the chart's data range. If you add new rows outside that range, use Select Data to extend it, or base the chart on an Excel Table.

Can I use a treemap on a Mac?

Yes, current Excel for Mac includes treemap charts, though ribbon labels and chart gallery positions can differ slightly from the Windows version.