how to change legend color in excel

Change Legend Color in Excel: A Simple Guide

By William Thompson
AD

In Excel, legend colors can significantly enhance the appearance of charts and make data more comprehensible. However, Excel doesn't provide a direct option to change legend colors. But fear not, with a bit of creativity and understanding of how Excel works, we can achieve this. Let's delve into how to change legend colors in Excel.

Before we start, note that changing legend colors involves a bit of workaround using conditional formatting and color scales. We'll be creating a reference column to hold our desired colors and then using this column to format our data series.

Preparing Your Data

For our example, let's assume we have a dataset with columns 'Category', 'Sales', and 'Profit'. We want to plot a stacked 100% bar chart with the legend colors of our choice.

AD
Change the Gridline Color in Excel Spreadsheets - 2 Ways!
Change the Gridline Color in Excel Spreadsheets - 2 Ways!
How to Change Legend Colors in Excel: 4 Easy Methods - ExcelDemy
How to Change Legend Colors in Excel: 4 Easy Methods - ExcelDemy
How to Change Background Color Tutorials in Excel
How to Change Background Color Tutorials in Excel

First, add a new column, say 'Color Code', and assign each category a color code from Excel's color palette. You can find these codes by clicking on the color icon while formatting cells. For instance, for the category 'A', you might use 'FF0000' for red.

Creating a Stacked 100% Bar Chart

Select your data (excluding the new 'Color Code' column), go to 'Insert' > 'Column' or 'Bar' > choose 'Stacked 100%'. This will create a stacked bar chart where the total of each series adds up to 100%.

How to Change Background Color Based on Value in Excel (6 Ways) - ExcelDemy
How to Change Background Color Based on Value in Excel (6 Ways) - ExcelDemy
How to Color Code Cells in Excel | MyExcelOnline
How to Color Code Cells in Excel | MyExcelOnline
Change gridline | grid color in Excel sheet (using settings and using VBA)
Change gridline | grid color in Excel sheet (using settings and using VBA)

Since we want to change the legend colors, click on the chart to select it, then click on the data series (the bars in the chart) to select it. Right-click and select 'Format Selection' or use theFormat dropdown in the 'Chart Styles' group on the 'Design' tab.

Applying the Color Codes to the Data Series

In the sidebar, under 'Fill', click on the color icon next to 'Solid fill'. Select 'More Fill Colors...' at the bottom of the palette.

AD

In the 'Standard' tab, there's a box for 'Custom'. Click on it, then under 'Custom', click on the color box, and type in your color code from the 'Color Code' column. Click 'OK' to apply this color to the selected data series. Repeat this for each data series to apply your desired legend colors.

How to Change the Chart Color Based on a Value in Excel - 2 Methods - ExcelDemy
How to Change the Chart Color Based on a Value in Excel - 2 Methods - ExcelDemy
How to Alternate Row Color Based on Cell Value in Excel - 10 Methods - ExcelDemy
How to Alternate Row Color Based on Cell Value in Excel - 10 Methods - ExcelDemy
Excel Change Color If Time Is in Range: 3 Suitable Ways - ExcelDemy
Excel Change Color If Time Is in Range: 3 Suitable Ways - ExcelDemy
Color-Coded Drop-Down Lists in Excel – Make Data Entry Smarter
Color-Coded Drop-Down Lists in Excel – Make Data Entry Smarter
How to Change Background Color in Excel (6 Easy Methods) - ExcelDemy
How to Change Background Color in Excel (6 Easy Methods) - ExcelDemy
How to change background color in Excel based on cell value
How to change background color in Excel based on cell value

Changing Legend Colors

Now, we'll format the legend to match the colors we've applied to the data series.

Right-click on the legend and select 'Format Legend'. In the sidebar, under 'Fill', select the color you want for your legend. Ensure the 'Legend Entries (Series)' are sorted in the order that matches your data series.

AD

Applying Color Scales for Better Visualization

To make our chart more visually appealing, we can use color scales that show the data range and distribution. Click on the data series to select it, then go to 'Format Selection' or use the 'Format' dropdown in the 'Chart Styles' group.

Excel Color Coded Dropdown‼️Use Amazing Excel Features #excel #exceltips #shorts #exceltricks
Excel Color Coded Dropdown‼️Use Amazing Excel Features #excel #exceltips #shorts #exceltricks
Change Cell Color based on Dropdown Selection | Excel Tutorial
Change Cell Color based on Dropdown Selection | Excel Tutorial
How to Filter by Multiple Colors in Excel (2 Ways) - ExcelDemy
How to Filter by Multiple Colors in Excel (2 Ways) - ExcelDemy

Under 'Fill', click on the color scale icon (other than the solid fill color icon). Choose the color scale that best represents your data. The legend colors will automatically update based on the scale chosen.

With this technique, you can create visually engaging charts with custom legend colors in Excel. Happy charting!

AD
AD