A treemap in Excel is a single-click way to visualize hierarchical data using nested rectangles, where each rectangle’s size represents a value and color often represents a category. This instantly turns a spreadsheet of sales figures or budget allocations into an interactive dashboard element. You can create a basic treemap in Excel by selecting your data and inserting the chart type, provided you have the latest version of the software. Older versions may require using a stacked bar chart as a workaround.

What You'll Need

  • A computer with Microsoft Excel installed. The treemap feature is available in Excel 2016 and later for Windows and Mac. It is not available in Excel Online or mobile apps.
  • A dataset with at least two columns. One column should contain the categories or labels you want to display, and the second must contain the numerical values that determine the size of the rectangles.
  • A clear understanding of your data hierarchy. The first column you select will act as the top-level grouping, and sub-items will appear as nested rectangles within those groups.

Step-by-Step

  1. Open your Excel workbook and navigate to the worksheet containing the data you want to visualize. Ensure your data is clean and formatted correctly as a table or a simple list of rows and columns. For the most reliable results, your data should not contain any blank rows or columns within the data range.
  2. Select all the cells that contain your data. This includes both the labels and the values. For example, if you have a list of sales figures by product category, select the entire column with the category names and the entire column with the sales numbers.
  3. Go to the Insert tab on the Excel ribbon at the top of the window. In the Charts group, look for the Charts pane or button. Depending on your Excel version, you may see a button labeled Charts or a pane with different chart types.
  4. In the Charts pane, find the category labeled Insert Small Charts or simply Charts. Within that section, locate the Treemap icon. It is often the first icon in the group and is a rectangle with a smaller rectangle nested inside it to represent hierarchy.
  5. <5>Click the Treemap icon. Excel will instantly generate the treemap chart on your worksheet. The chart will appear as a large rectangle composed of smaller, colored rectangles. The size of each smaller rectangle corresponds to the value in your data, and the color represents the category or label.
  6. Interact with your new treemap. You can click on any individual rectangle to see its specific data point in a tooltip. You can also click on the top-level category rectangles to zoom in, making the chart interactive and allowing you to drill down into the details of a particular group.
  7. Format the treemap to improve readability. Click on the chart to open the Chart Design and Format tabs that appear in the ribbon. Under the Chart Design tab, you can change the chart style or layout. Under the Format tab, you can change the font, fill colors, and borders of the chart elements.
  8. Adjust the treemap's layout and color scheme manually. Click on the specific rectangles you want to change. In the Format tab, look for the Shape Fill button to change the color of that specific rectangle or group of rectangles. You can also use the Format Data Series option to assign specific colors to different categories.
  9. Save your workbook to preserve the chart and your formatting changes. The treemap is a dynamic chart object, so it will update automatically if you change the underlying data in your spreadsheet.

Common Mistakes

One of the most common mistakes when creating a treemap is not selecting the correct data range. If you only select the labels and leave out the values, Excel will not know how to size the rectangles. The result will be a treemap where all rectangles are the same size, rendering the chart useless for the intended purpose. Always double-check that your data includes both the category labels and the numerical values.

Another frequent issue arises from data that is not hierarchical. A treemap is designed to show relationships and nesting. If your data is just a flat list of unrelated items, the chart will look messy and confusing. For example, if you have a list of 50 different cities with no grouping, the treemap will simply create 50 small, unconnected rectangles. To avoid this, ensure your data has a clear parent-child relationship, such as Country > City > District.

Users often overlook the importance of formatting their data before creating the chart. If your numerical values are text-formatted, Excel will not recognize them as numbers. This can cause errors or result in a treemap where the size of the rectangles does not accurately reflect the values. A simple way to fix this is to convert your data range into an official Excel Table by pressing Ctrl+T. This ensures that Excel treats your data correctly and automatically expands the treemap when new data is added.

Tips

To make your treemap more effective, consider using it to compare parts of a whole. The size of the rectangles directly visualizes the magnitude of each value relative to the others. This is particularly useful for budgeting, where you can see at a glance which expense categories are taking up the most space.

Use color strategically. The default color scheme in Excel is usually a palette of pastel colors. While functional, it may not be the most appealing or professional-looking. You can manually change the fill colors of specific rectangles to highlight key data points. For example, you could make the rectangle representing the highest sales figure stand out by changing its color to red or a dark blue. This draws the eye to the most important information.

Remember that the first column you select becomes the top-level group. Understanding this hierarchy is crucial for interpreting the chart correctly. If you want to change the hierarchy, you can simply reorder the columns in your spreadsheet before selecting the data for the chart. This allows you to easily switch between different levels of detail in your analysis.

Troubleshooting

If your treemap does not appear or looks incorrect, first check your data selection. Ensure that you have selected both the labels and the values. If you have selected the correct data but the chart still looks wrong, check the formatting of your values. Try converting the range to a table or manually formatting the cells to Number or General.

If you see a blank chart or a chart with only one rectangle, it is likely because your data is not hierarchical. A treemap requires at least two levels of data. Verify that your data has a clear grouping structure, such as a parent category and a sub-item.

If the chart is too crowded or the rectangles are too small to read, try zooming out of the worksheet or adjusting the chart size. You can also try simplifying your data by removing less important items or aggregating smaller values into a single category.

If you are using a very large dataset, Excel might take a moment to generate the chart. Be patient and do not close the dialog box prematurely. If the chart generation is taking an excessively long time, it could be due to a very large number of data points or a slow computer. In this case, try simplifying your data or closing other applications to free up system resources.

Frequently Asked Questions

Can I use a treemap in Excel Online?

No, the treemap chart type is not available in Excel Online. It is a feature that is only available in the desktop versions of Excel for Windows and Mac.

How do I change the size of the rectangles in a treemap?

The size of the rectangles is automatically determined by the values in your data. To change the size, you must edit the underlying data values in your spreadsheet. The chart will update automatically to reflect the new sizes.

Why are some of my rectangles the same color?

By default, Excel assigns a different color to each unique category or label. If you have multiple items with the same category, they will share the same color. You can manually change the color of individual rectangles by clicking on them and using the Shape Fill option.

Can I export my treemap as an image?

Yes, you can export your treemap as an image. Click on the chart to select it, then go to the File tab and choose Save As. In the Save As dialog box, choose the file format that supports images, such as PNG or JPEG.

How do I update the treemap when I add new data?

If you have converted your data range into an official Excel Table (Ctrl+T), the treemap will automatically update when you add new rows of data. If you did not use a table, you will need to add the new data to your existing selection and then refresh the chart by right-clicking on it and selecting Refresh.

Is there a keyboard shortcut to insert a treemap?

There is no built-in keyboard shortcut to insert a treemap chart in Excel. You must use the ribbon interface to access the chart types.