Smart Systems for Home

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

Treemap in Excel: How to Build One Step by Step

· 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

Excel does not have a Treemap chart type in every version, but modern Excel (Excel 2016 and later on Windows, Excel for Microsoft 365, and Excel for Mac) does. To build one, arrange your data in two columns — a category column and a value column — select the whole range, then go to Insert > Treemap (in the Charts group, under the Hierarchies or Insert Statistic/Waterfall/Treemap/Sparkline buttons depending on your version). Excel turns each category into a rectangle sized in proportion to its value. That is the whole shortcut; the rest of this guide covers getting the data right, formatting the result, and fixing the cases where Excel refuses to draw it.

A treemap is a compact way to show part-to-whole comparisons across many categories. A pie chart with 25 slices is unreadable; a treemap handles it because rectangles use area rather than angle, so viewers can still compare sizes and the layout stays tidy. Labels can often differ slightly by Excel version, device and region, so if you do not see the exact button named below, look in the same area of the ribbon.

What You'll Need

  • A version of Excel that supports treemap charts: Excel 2016 or newer, Excel for Microsoft 365, Excel for Mac 2016 or newer, or Excel for the web (treemap support in the web version is limited, so formatting is easier on desktop). Older versions such as Excel 2013 and earlier do not include the chart type.
  • A data table with at least one category column (text) and one value column (numbers) — no blank rows inside the range and no subtotal rows mixed in.
  • Numbers stored as actual numbers, not text. If Excel shows them left-aligned or with a green triangle error marker, they need converting first.
  • Optional but useful: a second level of grouping, such as region then product, if you want nested rectangles.

Step-by-Step

1. Lay out the data cleanly

  1. Put the category name in one column and its numeric value in the adjacent column.
  2. Give both columns header labels in the first row, for example Category and Sales. Excel uses the headers for the chart and the legend, so include them.
  3. Remove any total or subtotal rows from the selected range. A total row will appear as an extra oversized rectangle and distort the proportions.
  4. Check that every value cell contains a number. A cell with a trailing space, a currency symbol typed as text, or an apostrophe before the number will be read as zero or as text. Use Data > Text to Columns or retype the values if needed.

2. Select the range and insert the chart

  1. Select the category and value columns including headers — for example A1:B10.
  2. Go to Insert on the ribbon and find the chart buttons. Depending on your version, treemap sits under a button labelled Insert Hierarchy Chart (older 2016 builds) or directly as a Treemap icon grouped with Waterfall and Funnel charts.
  3. Click Treemap. Excel places the chart on the sheet.

3. Add a second category level (optional)

  1. If you have three columns — for example Region, Product, Sales — select all three columns.
  2. Insert the treemap again. Excel nests the smaller category inside the larger one, drawing a border around each group.
  3. Right-click a rectangle and use the options to group or ungroup if the nesting is not what you expected; the exact wording varies by version.

4. Format the chart so it reads clearly

  1. Click the chart, then use the Chart Elements plus button at the top-right corner to switch the legend, data labels and title on or off.
  2. Right-click any rectangle and choose Format Data Series. From the task pane you can set the rectangle border colour and width — a thin white border helps separate similar-sized blocks.
  3. Turn on data labels (Chart Elements > Data Labels). For a crowded map, choose More Options and set the label to show only the value or only the category to avoid text overlap.
  4. Resize the chart by dragging its corner. Treemaps redraw when resized, so a larger chart gives labels more room.
  5. Change the chart title by clicking it once and typing.

5. Sort the underlying data to control the layout

  1. Treemap layout is driven by the order and size of the source data, not by a manual arrangement.
  2. Sort your table descending by value (Data > Sort) so the largest blocks appear first in the layout.
  3. If the chart does not update, right-click the chart and choose Refresh if that option exists, or simply reinsert it after sorting.

Common Mistakes

  • Leaving totals in the data. The total becomes a huge rectangle and crushes every real category into a sliver. Remove it before selecting the range.
  • Numbers stored as text. Excel treats them as zero, so all rectangles come out equal-sized or the chart is blank. Convert them first.
  • Too many tiny categories. Hundreds of categories produce unreadable specks. Group small items into an "Other" row.
  • Using a treemap for time series. Treemaps show parts of a whole at one point in time. Use a line chart for trends over months.
  • Assuming area perception is exact. Readers judge rectangle area imprecisely. Add data labels so the numbers are visible.
  • Blank cells inside the range. A blank category cell can be silently ignored or leave a gap. Clean the data first.

Tips

  • Keep the number of visible rectangles to roughly 20 or fewer for a presentation; more than that works only on a large screen with few labels.
  • Use consistent colours that map to the grouping level, not to individual rectangles, so the eye can follow groups.
  • If you need exact comparisons, pair the treemap with a small PivotTable or bar chart beside it.
  • Two-level treemaps are excellent for budgets: Department as the outer group, Expense type as the inner.
  • Copy the chart to a separate sheet for a clean layout, then size it to fill the printable area when exporting to PDF.

Troubleshooting

  • The Treemap button is greyed out or missing. Either your Excel version is too old (2013 or earlier, which has no treemap), or the selection does not contain numeric data. Select the range again including headers, and confirm values are numbers.
  • The chart appears empty or shows one block. This usually means the value column is text. Convert with Data > Text to Columns and Finish, or multiply the range by 1 in a helper cell and paste back as values.
  • Labels are cut off or overlapping. Enlarge the chart, reduce label content to one field, or reduce the number of categories. There is no automatic label-fitting guarantee on small rectangles.
  • Chart does not update after editing data. Confirm the chart is linked to the range you edited; if you inserted new rows, reinsert or extend the source range.
  • It works on one computer but not another. Chart availability depends on the Excel version installed, not on the file. Opening an older-format file in an older Excel will not add the chart type.

Frequently Asked Questions

Can I make a treemap in Excel 2013?

No. Treemap charts were introduced in Excel 2016. In earlier versions you would have to build a rectangle layout manually with shapes, which is not practical for real data.

Does a treemap work in Excel for the web?

Yes, recent versions of Excel for the web can display and insert treemap charts, but the available formatting and editing options are more limited than on desktop. If you need fine control over labels and borders, use the desktop app.

Can I use negative numbers in a treemap?

Treemaps represent area, and negative areas have no meaning. Negative values are typically ignored or distorted. Show negatives in a separate bar chart instead.

How many categories should a treemap show?

There is no fixed rule, but readability drops quickly above roughly 20 visible blocks. Combine small categories into an "Other" group.

Will the treemap update automatically when my data changes?

Yes, if the chart's source range covers the cells you change. Edits inside the existing range update the chart; adding rows outside the range requires extending the range or reinserting the chart.

Can I change the colours of individual rectangles?

You can change the whole series colour scheme through Format Data Series. Setting one rectangle to a different colour usually requires selecting it individually after clicking the chart twice, and behaviour varies by version.