Conditional Formatting Entire Column Based on Another Column in Excel

In Excel, conditional formatting is used to highlight any cells based on predetermined criteria and the value of those cells. We can also apply conditional formatting to highlight an entire column based on another column with some easy steps.

Excel Conditional Formatting Entire Column Based on Another Column

Let’s say we have a Sales Report for the year 2022 of a company. Every month there was a Sales Target. Now we will use conditional formatting to highlight where the Actual Sales were higher than the Sales Target.

Dataset to Apply Conditional Formatting


Step 1 – Select Single Column to Apply Rules

To apply Conditional Formatting, first you have to select the cells. If you want to highlight the entire row after applying conditional formatting, you need to select all of your datasets. But to highlight cells from a single column you just need to select the cells of that column.

For our dataset, we want to apply conditional formatting to Column D. So, we have selected the cells of Column D only.

Selecting Cell Range

Read More: Excel Conditional Formatting on Multiple Columns


Step 2 – Open New Format Rule Window from Conditional Formatting

Let’s choose suitable formatting rules.

  • Go to the Home tab and click on Conditional Formatting to expand it.

Selecting Conditional Formatting from Home Tab

  • Different rules for applying conditional formatting are displayed. Let’s choose a rule based on our criteria.
  • Select New Rule.

Opening New Rule from Conditional Formatting

  • A window named New Formatting Rule will appear.
  • Select Use a formula to determine which cells to format from the Select a Rule Type Box.

Choosing Rule type

Read More: Applying Conditional Formatting for Multiple Conditions in Excel


Step 3 – Insert Formula for Conditional Formatting

A box named Format values where this formula is true will appear.

  • Enter the following formula in the box:
=$D5>$C5
  • Now we fix the formatting style. Click on the Format button.

Inserting Formula for Conditional Formatting

Here, the formula will compare the value of Column D with the value of Column C in the same row, and if the value of Column D of a row is greater than the value of Column C in the same row, the cell of Column D will be formatted.

Read More: How to Use Conditional Formatting in Excel


Step 4 – Determine Formatting Style

After clicking on the Format box, a new window named Format Cells will appear, where different formatting styles can be selected from the different tabs of the window.

  • From the Number tab, choose Accounting.

Choosing Number Format for Selected Column

  • From the Font tab, select Bold as the font style.

Selecting Font Style

  • From the Border tab, select Outline Presets.

Choosing Presets from Border Tab

  • From the Fill tab, select a preferred Background Color.
  • Additionally, we could select a Pattern Color, Pattern Style, and Fill Effects.
  • Click OK.

Choosing Background Color for Cells


Step 5 – Apply Conditional Formatting to Selected Column Based on Another Column

  • After Step 4, you will see your selected formatting style in the Preview box in the New Formatting Rule window.
  • Click OK.

Overview of Settings in New Formatting Rule

  • Conditional formatting is applied to Column D.

Excel Conditional Formatting Entire Column Based on Another Column

Note: If the cell of Column D of a particular row has a greater value than the value of the Column C cell of that row, the cell of Column D is highlighted with a light blue color and the font is in bold.

Additional Tips

  • To apply Conditional Formatting to more cells of the same column in the future, select some additional cells (for example, up to 100 rows) and  repeat the steps above.
  • Alternatively, convert the dataset into a Table (Insert > Table) including additional rows. Then apply Conditional Formatting to the selected column and the specified conditional formatting will be automatically applied to future inserts.

Things to Remember

  • Make sure to only refer to the columns as Absolute Cell References, not the row numbers.
  • Always refer to the top left cell of the selected column where the values start.
  • If you copy the rule with Format Painter from one column to another, make sure to check the column references.

Download Practice Workbook


Related Articles

<< Go Back to Conditional Formatting with Multiple Conditions | Conditional Formatting | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Prantick Bala
Prantick Bala

PRANTICK BALA is a marine engineer who loves exploring Excel and VBA programming. Programming, to him, is a time-saving tool for efficiently managing data, files, and internet tasks. He is proficient in Rhino3D, Maxsurf, C++, MS Office, AutoCAD, Excel, and VBA and goes beyond the basics. Armed with a B.Sc in Naval Architecture & Marine Engineering from BUET, he has transitioned into the role of a content developer. Beyond his work, find him immersed in books, exploring new... Read Full Bio

2 Comments
  1. Hi, great site you have here !
    i have another problem, lets see if you could help.
    i have 2 columns, which is column A and column B, i want to change cell color of column A based on column B cell value (0, negatives value, and positive value)
    if column B cell value is negative, then column A cell text color is red
    if column B cell value is positive, then column A cell text color is blue
    if column B cell value is 0, then column A cell text color is black.

    please help

    • Thank you, Calvin, for your query. I’m replying on behalf of ExcelDemy. You need to select the values of column A and then apply the conditional formatting to them. The condition will be similar to this image. Steps do the formatting is already mentioned in this article.

      • Here is the output.

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo