To insert a Treemap chart in Excel, arrange your data in columns from broad category to specific item, followed by a numeric value. Select the table, then choose Insert > Insert Hierarchy Chart > Treemap. Excel turns the values into nested rectangles, making it easier to compare categories and see how each item contributes to the whole.
What You’ll Need
- Excel for Microsoft 365 on Windows for the ribbon steps below. Treemap charts are also available in supported desktop versions of Excel 2016 and later. On Mac, look under the Insert tab for the hierarchy chart options; ribbon grouping and labels can differ slightly. Excel for the web may have a different command layout or feature availability.
- A small, tidy table. Use one column for each level of the hierarchy and a final column containing the numeric measure to compare, such as sales, units, or budget.
- At least one category level and one value column. For a more useful nested chart, include two or more levels, such as Department and Product.
- Nonnegative numeric values. Treemaps size rectangles according to values, so text, blank values, or negative amounts can prevent a meaningful display.
Step-by-Step
- Plan the hierarchy. Decide what the largest groups should represent and what details should appear inside each group. For example, use Region as the first level, Product as the second level, and Sales as the measure. Each row should describe one specific item at the lowest level you want to show. If your data only has a category and a value, that can still make a Treemap, but it will have no deeper nesting.
- Arrange the source data in columns. Put each hierarchy level in its own column, from broadest to most specific, and put the values in the last column. For example, the headers could be Region, Product, and Sales. A few rows might be North / Laptop / 120, North / Tablet / 80, South / Laptop / 90, and South / Tablet / 60. Repeat the parent label on every applicable row; the repeated North and South labels tell Excel which products belong together.
- Check and clean the table. Use a single header row, avoid merged cells, and remove completely blank rows or columns inside the data. Make sure the values are numbers rather than text that only looks numeric. Correct spelling differences in category names: Excel treats “North” and “North ” (with an extra space) as different labels. Remove subtotal and grand-total rows, because Excel will chart those values alongside the underlying items and count them twice.
- Select the full data range. Include all hierarchy columns, the numeric values, and the header row. If the data is a continuous block, click one cell in it; Excel will often recognize the full range automatically. To make the range easier to manage as it grows, you can first select it and choose Insert > Table, then confirm that My table has headers is selected. A table is optional, but it helps include new rows when you update the source.
- Insert the chart. With the source range selected, open the Insert tab. In the Charts area, select Insert Hierarchy Chart, then choose Treemap. In some ribbon layouts, the hierarchy chart button is a small icon or is grouped under recommended charts. If you do not see it, confirm that you are using a supported desktop version and that the active selection includes the category and value columns.
- Review the hierarchy Excel created. Excel places the chart on the worksheet and uses the order of the category columns to build the nested groups. The first category column forms the broad groups; later category columns form smaller subdivisions. The value column controls rectangle size. Check that items are under the intended parent and that the largest rectangles correspond to the largest values. If the grouping is wrong, check the column order and source labels rather than trying to rearrange individual rectangles.
- Add a useful title and labels. Select the chart, then use Chart Design > Add Chart Element to add a chart title or data labels. Choose a short title that states the measure and period, such as “Sales by Region and Product.” To adjust label details, right-click a label and choose Format Data Labels, or open the formatting pane. Available label options can vary with the Excel version and chart; show category names or values only when they remain readable.
- Improve the chart’s appearance and position. With the chart selected, use Chart Design > Change Colors to try a palette with enough contrast. You can also pick a style from the Chart Styles gallery. Drag the chart by its border to move it, or drag a corner handle to resize it. Give the chart enough room for labels, especially when there are many small rectangles. Save the workbook after checking that the title, labels, and colors make the chart understandable.
Common Mistakes
Adding a total row to the plotted data: A grand total is not another product or category. Including it makes the chart compare the total with the parts that already make up that total, so the picture becomes misleading. Keep totals outside the source range or remove them before creating the chart.
Putting values before categories: Excel needs the category columns to define the hierarchy and the numeric measure to size the rectangles. Keep the broad-to-specific labels together and place the measure after them. If the chart treats a column unexpectedly, check the selected range and reorder the source columns.
Using inconsistent labels or blank categories: A missing parent name can create an unclear or unexpected group, while small differences in spelling can split what should be one category. Standardize labels before charting and fill in missing hierarchy levels where appropriate.
Expecting negative values to work like positive ones: A Treemap represents relative magnitude with area and is not designed to show negative amounts as ordinary rectangles. Do not hide or convert negative values without a clear reason. If gains and losses both matter, choose a chart type that can communicate positive and negative values directly.
Trying to label every tiny rectangle: A chart with too many items may be technically correct but difficult to read. Adding labels repeatedly will not create more space. Reduce the number of displayed items, group minor entries as “Other” in the source data, or make the chart larger.
Tips
- Keep the hierarchy focused. Two or three meaningful category levels are usually easier to interpret than a long chain of tiny subdivisions. Choose levels that answer a specific question, such as which product groups account for the most sales.
- Sort the source data thoughtfully. Sorting rows by parent category and then by value can make the source easier to inspect, although the Treemap layout is determined by the data and Excel’s charting behavior. Do not rely on position alone to communicate exact rankings; show values or provide a separate detail table.
- Use color with a purpose. A single, restrained palette can make parent groups easier to distinguish. Avoid using many bright colors unless color represents an additional, clearly explained category. Check contrast and do not rely on color alone to convey important information.
- Keep a detail table nearby. Treemaps are best for seeing relative size and hierarchy, not reading exact values for every small item. A source table, data labels, or a separate summary can provide the precision the chart cannot show clearly.
- Make updates at the source. Edit category names or values in the worksheet rather than trying to reshape the chart manually. If your chart uses a normal range and new rows are added outside it, update the chart’s data range; an Excel Table can make expanding data easier to include.
Troubleshooting
Treemap is missing from the Insert menu: Confirm that you are using a version of Excel that supports hierarchy charts and that the workbook is open in the desktop app if the web version does not offer the command. Select a contiguous range containing both text categories and numeric values, then check Insert again. On Mac, look for Treemap in the hierarchy chart options on the Insert tab; the ribbon may not match the Windows layout exactly.
The chart is blank or some values are missing: Check that the value column contains actual numbers, not text, errors, or blanks. Also check for negative values and confirm that the chart’s source range includes the rows you expect. If the data was added later, select the chart and inspect its source data or expand the source table.
Groups appear separately even though they should be together: Compare parent labels carefully for extra spaces, spelling differences, or inconsistent capitalization. Correct the source data so each item uses the same parent label. Then check that the parent category column comes before the child category column.
The chart is hard to read: Reduce the number of rows shown, combine low-value items into a sensible group in the source, enlarge the chart, or remove labels that overlap. You can try another chart style or color palette, but first make sure the chart is not overcrowded by too many small categories.
The displayed sizes seem wrong: Verify that you selected the intended measure column and that there are no subtotal rows or duplicate records inflating values. Check whether the chart’s data range includes extra rows. If the chart is meant to compare totals across groups, confirm that each underlying item appears once in the source.
Frequently Asked Questions
What data layout does an Excel Treemap need?
Use one column per category level, ordered from broadest to most specific, followed by a numeric value column. Each row should describe one leaf item. Repeat parent labels on the rows for their child items, and include a header row so the chart can use meaningful field names.
Can I make a Treemap with only one category column?
Yes. A category column plus a numeric value column can produce a Treemap with one level of rectangles. Add another category column if you want to see smaller groups nested inside larger groups, such as products inside departments.
Can I change which column controls rectangle size?
The numeric measure in the chart’s source data determines the rectangle sizes. To use a different measure, edit the source range or change the chart’s data source so it uses the intended numeric column. Confirm the new measure has suitable, nonnegative values.
How do I show values on the rectangles?
Select the chart and use Chart Design > Add Chart Element > Data Labels if that option is available for your version and chart. To adjust what appears, open Format Data Labels and choose from the options Excel provides. Labels may be omitted or crowded on very small rectangles, so show only the details that fit.
Can I use a Treemap for negative numbers?
A Treemap is intended to represent parts of a whole using nonnegative values. Negative amounts do not have a straightforward area in this chart type. For data that includes losses and gains, use a chart that displays values on both sides of zero, or separate the positive and negative measures clearly.
Does a Treemap update when I change the worksheet data?
Yes, chart values and category labels update when you edit cells included in the chart’s source. If you add rows beyond a normal selected range, the chart may not include them automatically. Use an Excel Table or update the chart’s source range to include the new records.
Related
- INDEX MATCH in Google Sheets: Search Another Sheet
- How to Filter Rows in Google Sheets
- Word: Make One Page Landscape Without Changing Others
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Gantt Charts: How to Skip Weekends and HolidaysYes. In Excel for Microsoft 365, you can make a Gantt schedule skip weekends by building its timeline…
- Google Sheets Chart Custom Font: What You Can ChangeYes, you can change a chart’s font in Google Sheets: select the chart, open the Chart editor, choose…
- Excel Chart: How to Change Bar OrderTo change the order of bars in an Excel chart, either sort the chart’s source data, reverse the…
- Google Sheets Pie Charts: Create, Customize, and Fix ThemTo make a pie chart in Google Sheets, put category names in one column and their numeric values…
- Excel Pivot Chart Example: Build a Sales DashboardAn Excel PivotChart example is a chart that summarizes sales by month and region, then lets you rearrange…
- Excel Chart Legend Text: Rename Series and Edit LabelsTo change legend text in an Excel chart, select the chart, choose Chart Design > Select Data, select…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.