Excel: Color Code Based on Another Cell's Value

Jacob Jul 28, 2026

Color coding in Excel can significantly enhance the readability and organization of your data. One powerful way to achieve this is by coloring cells based on the value in another cell. This technique, known as conditional formatting, allows you to apply different colors to cells depending on the value in a specific cell or range. Let's explore how to do this in detail.

How to change background color in Excel based on cell value
How to change background color in Excel based on cell value

Before we dive into the steps, let's consider a scenario where you have a list of sales figures and you want to color code them based on whether they are above or below the average. This can help you quickly identify high and low performing sales. Now, let's get started.

Color Coded Drop-Down Lists in Excel‼️ #excel
Color Coded Drop-Down Lists in Excel‼️ #excel

Understanding Conditional Formatting

Conditional formatting is a feature in Excel that allows you to apply formatting to a cell or range of cells based on certain conditions. These conditions can be based on the value of the cell, the value of another cell, or even the result of a formula.

How To Change Background Or Font Color Based On Cell Value In Excel?
How To Change Background Or Font Color Based On Cell Value In Excel?

In our scenario, we'll use a rule that applies formatting based on the value of another cell. Specifically, we'll color cells red if their value is below the average and green if it's above the average.

Setting Up Your Data

the words count or sum cell's based on cell color in excel are shown
the words count or sum cell's based on cell color in excel are shown

For this example, let's assume you have a list of sales figures in Column A (A2:A10). In cell B1, you've calculated the average of these sales using the formula `=AVERAGE(A2:A10)`. This cell will serve as our reference point for color coding.

Now, let's move on to applying the conditional formatting rules.

Applying Conditional Formatting Rules

How to color code excel cells based on value
How to color code excel cells based on value

To apply conditional formatting, select the range you want to format (in this case, A2:A10), then click on 'Conditional Formatting' in the 'Home' tab. From the dropdown menu, select 'New Rule...'.

In the 'New Formatting Rule' dialog box, select 'Use a formula to determine which cells to format'. In the 'Format values where this formula is true:' box, enter the following formula: `=$A2>$B$1`. This formula checks if the value in each cell in Column A is greater than the average in cell B1.

Formatting Based on the Formula

Excel Color Coded Dropdown‼️Use Amazing Excel Features #excel #exceltips #shorts #exceltricks
Excel Color Coded Dropdown‼️Use Amazing Excel Features #excel #exceltips #shorts #exceltricks

After entering the formula, click on the 'Format...' button. In the 'Format Cells' dialog box, select the 'Fill' tab, choose the green color you want to apply, and click 'OK'. This will apply the green fill to cells where the formula is true, i.e., where the sales figure is above the average.

Now, let's create another rule for cells where the sales figure is below the average.

How to Change Background Color Based on Cell Value in Excel?
How to Change Background Color Based on Cell Value in Excel?
The If Statement is Based on the Cell Color in Excel
The If Statement is Based on the Cell Color in Excel
How to Color Code Cells in Excel (3 Methods) - ExcelDemy
How to Color Code Cells in Excel (3 Methods) - ExcelDemy
Color Coding Drop-down list in Excel l Drop down list in cell #excelshorts #ytshorts #shorts
Color Coding Drop-down list in Excel l Drop down list in cell #excelshorts #ytshorts #shorts
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
Change Cell Color based on Dropdown Selection | Excel Tutorial
Change Cell Color based on Dropdown Selection | Excel Tutorial
How to Sum Cells by Color in Excel (Get it to update automatically)
How to Sum Cells by Color in Excel (Get it to update automatically)
Change the Gridline Color in Excel Spreadsheets - 2 Ways!
Change the Gridline Color in Excel Spreadsheets - 2 Ways!
excel create color - coded drop - down menu
excel create color - coded drop - down menu
Excel: Change the row color based on cell value
Excel: Change the row color based on cell value
How to Filter by Multiple Colors in Excel (2 Ways) - ExcelDemy
How to Filter by Multiple Colors in Excel (2 Ways) - ExcelDemy
How to Change Cell Color Based on a Value in Excel (5 Ways) - ExcelDemy
How to Change Cell Color Based on a Value in Excel (5 Ways) - ExcelDemy
the color coded drop down in excel is shown with an arrow pointing to it
the color coded drop down in excel is shown with an arrow pointing to it
How to highlight row if cell contains text/value/blank in Excel?
How to highlight row if cell contains text/value/blank in Excel?
Change Cell Colour using Conditional Formatting
Change Cell Colour using Conditional Formatting
Excel Tutorial - How to Color Code Financial Models
Excel Tutorial - How to Color Code Financial Models
Excel Custom Number Format Guide • My Online Training Hub
Excel Custom Number Format Guide • My Online Training Hub
📊 Color Coded Dropdowns in Google Sheets
📊 Color Coded Dropdowns in Google Sheets
Excel Tips: Count/sum cells by color (background, font, conditional formatting)
Excel Tips: Count/sum cells by color (background, font, conditional formatting)
How to Get Cell Color in Excel (2 Methods) - ExcelDemy
How to Get Cell Color in Excel (2 Methods) - ExcelDemy

Creating a Second Rule

In the 'New Formatting Rule' dialog box, click on 'Add another rule'. In the 'Format values where this formula is true:' box, enter the formula `=$A2<=$B$1`. This formula checks if the value in each cell in Column A is less than or equal to the average in cell B1.

Again, click on the 'Format...' button, select the red color you want to apply, and click 'OK'. This will apply the red fill to cells where the formula is true, i.e., where the sales figure is below the average.

Now, when you look at your data, you'll see that cells with sales figures above the average are colored green, and those below the average are colored red. This makes it easy to identify high and low performing sales at a glance.

Remember, conditional formatting is a powerful tool that can be used in many different ways. You can apply formatting based on the value of a cell, the result of a formula, or even the day of the week. Experiment with different rules and formulas to find what works best for your data.

In the world of data analysis, every bit of insight helps. Color coding based on the value in another cell is just one way to gain that extra bit of insight. Happy exploring!