Excel Conditional Formatting Based on Multiple Values of Another Cell

In this article, I’ll show you how you can apply Conditional Formatting in Excel based on multiple values of another cell. You’ll learn to apply Conditional Formatting on a single column and multiple columns, as well as on a single row or multiple rows, based on multiple values from multiple rows or columns.


Download Practice Workbook


Conditional Formatting Based on Multiple Values of Another Cell in Excel

Here we’ve got a data Set with the sales record of some products of five years of a company named Mars group.

Data Set to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

Today our objective is to apply Conditional Formatting on this data set based on multiple values of another cell.


1. Conditional Formatting on a Single Column based on Multiple Values of Another Cell

First of all, let’s try to apply Conditional Formatting on a single column based on multiple values of multiple columns.

For example, let’s try to apply conditional formatting on the names of the products whose average sales in the five years are more than 500.

I am showing you the step by step procedure to accomplish this:

Step 1: Selecting the Column and Opening Conditional Formatting

➤ Select the column on which you want to apply Conditional Formatting.

➤ Then go to the Home > Conditional Formatting > New Rule option in Excel Toolbar.

Here I’ve selected column B (Product Name).

Selecting Single Column to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

Step 2: Inserting the Formula in the New Formatting Rule Box

➤ Click on New Rule. You’ll get a dialogue box called New Formatting Rule.

➤ Then click on Use a formula to determine which cells to format. Insert the formula there:

=AVERAGE(C4,D4,E4,F4,G4)>500

Or

=AVERAGE($C4,$D4,$E4,$F4,$G4)>500

Notes:

  • Here, C4, D4, E4, F4, and G4 are the cell references of the first row, and AVERAGE()>500 is my condition. You use your own.
  • When you apply Conditional Formatting on a single column based on multiple Values of another column, you can use either the Relative Cell References or the Mixed Cell References (Locking the Columns) of the cells, but not the Absolute Cell References.

Step 3: Selecting the Desired Format from the Format Cells Dialogue Box

➤ Click on Format. You’ll be directed to the Format Cells dialogue box.

Clicking on Format to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

➤ From the formats available, choose the format you want to apply to the cells that fulfill the criteria.

I chose the light brown color from the Fill tab.

Selecting Format to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

Step 4: The Final Output

➤ Click on OK. You’ll be directed back to the New Formatting Rule dialogue box.

➤ Again click on OK. You’ll get the names of the products whose average sales are more than 500 marked in your desired format (Light brown in this example).

Read more: Conditional Formatting Based On Another Cell in Excel


2. Conditional Formatting on Multiple Columns Based on Multiple Values of Another Cell

You can also apply Conditional Formatting on multiple columns based on multiple values of multiple columns in Excel.

For example, let’s try to apply Conditional Formatting on the names of the products whose average in the years 2016, 2018, and 2020 are greater than 500, along with the years.

The steps are the same as method 1. Just in step 1, select all the columns on which you want to apply Conditional Formatting.

Here I’ve selected columns B, C, E, and G.

Selecting Multiple Columns to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

And in step 2, use the Mixed cell References (Locking the Columns) of the cells of the first row in the formula, not the Relative Cell References or the Absolute Cell References.

=AVERAGE($C4,$E4,$G4)>500

Entering Formula to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

Note:

  • When you apply Conditional Formatting on multiple columns based on multiple values from multiple columns, you must use the Mixed Cell References (Locking the Column).

Then choose the desired format from the Format Cells Dialogue Box. Then click on OK twice.

You will get the desired format applied to the cells of the multiple columns that fulfill your criteria.

More Example:

If you want, you can apply Conditional Formatting to the whole data set.

Just select the whole data set in step 1.

Selecting Whole Data Set to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

And apply the Mixed Cell References of the cells of the first row in the formula.

=AVERAGE($C4,$D4,$E4,$F4,$G4)>500

Inserting Formula to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

Then select the desired format.

You’ll get cells of the whole data set that fulfill the criteria are marked in your desired format.


Similar Readings:


3. Conditional Formatting on a Single Row Based on Multiple Values of Another Cell

You can also apply Conditional Formatting on a single row based on multiple values of multiple rows in Excel.

For example, let’s try to apply Conditional Formatting to the years when the average sales of all the products were greater than 500.

The steps are the same as method 1. Just in step 1, select the row on which you want to apply Conditional Formatting.

Here I’ve selected C3:G3 (Years).

Selecting Single Row to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

And in step 2, use the Relative Cell References or the Mixed cell References (Locking the Rows) of the cells of the first column.

=AVERAGE(C4:C12)>500 

Or

=AVERAGE(C$4:C$12)>500 

Entering Formula to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

Notes:

  • Here, C4:C12 are the cell references of my first column. You use your one.
  • When you apply Conditional Formatting on a single row based on multiple values from multiple rows, you must use either the Relative Cell References or the Mixed Cell References (Locking the Row).

Then choose the desired format from the Format Cells Dialogue Box. Then click on OK twice.

You will get the desired format applied to the years that had an average sales of more than 500.


4. Conditional Formatting on Multiple Rows Based on Multiple Values of Another Cell

Finally, you can also apply Conditional Formatting on single rows based on multiple values of multiple rows.

For example, let’s try to apply Conditional Formatting to the years, along with the sales when the average sales of the products Laptop, Landline, Refrigerator, and Table Fan were more than 500.

The steps are the same as method 1. Just in step 1, select the rows on which you want to apply Conditional Formatting.

Here I’ve selected C3:G3, C5:G5, C7:G7, C9:G9, and C11:G11.

Selecting Multiple Rows to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

And in step 2, use the Mixed cell References (Locking the Rows) of the cells of the first column in the formula.

=AVERAGE(C$5,C$7,C$9,C$11)>500

Inserting Formula to Apply Conditional Formatting Based on Multiple Values of Another Cell in Excel

Note:

  • When you apply Conditional Formatting on single rows based on multiple values from multiple rows, you must use the Mixed Cell References (Locking the Row).

Then choose the desired format from the Format Cells Dialogue Box. Then click on OK twice.

You will get the desired format applied to the cells that fulfill your condition.


Things to Remember

  • While applying Conditional Formatting to a single column or multiple columns, insert a formula consisting of the cells of the first row.
  • Similarly, while applying Conditional Formatting to a single row or multiple rows, insert a formula consisting of the cells of the first column.
  • While applying Conditional Formatting on a single row or a single column, you can use either the Relative Cell References or the Mixed Cell References (Locking the column in the case of columns and locking the row in the case of rows.).
  • But while applying Conditional Formatting on multiple rows or multiple columns, you must apply the Mixed Cell References (Read this to know the reason behind this.)

Conclusion

Using these methods, you can apply Conditional Formatting based on multiple values of another cell in any data set in Excel. Do you have any questions? Feel free to ask us.


Related Readings

Rifat Hassan

Rifat Hassan

Hello! Welcome to my profile. Here I will be posting articles related to Microsoft Excel. I am a passionate Electrical Engineer holding a Bachelor’s degree in Electrical and Electronic Engineering from Bangladesh University of Engineering and Technology. Besides academic studies, I always love to keep pace with the revolution in technology that the world is rushing towards day by day. I am diligent, career-oriented, and ready to cherish knowledge throughout my life.

We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo