banner



How Do I Change The Color Of A Cell In Excel Based On Value?

Sentry Video – Highlight Rows based on Prison cell Values in Excel

In instance y'all adopt reading written teaching instead, below is the tutorial.

Conditional Formatting allows you to format a cell (or a range of cells) based on the value in it.

Only sometimes, instead of just getting the prison cell highlighted, you may want to highlight the entire row (or cavalcade) based on the value in one cell.

To give you an example, below I have a dataset where I take highlighted all the rows where the name of the Sales Rep is Bob.

Highlight Rows Based on Cell Value - which is Bob

In this tutorial, I will show you lot how to highlight rows based on a jail cell value using conditional formatting using different criteria.

Click here to download the Example file and follow along.

Highlight Rows Based on a Text Criteria

Suppose you have a dataset as shown beneath and you want to highlight all the records where the Sales Rep name is Bob.

DataSet where you want to highlight rows where name is Bob

Hither are the steps to practice this:

  1. Select the entire dataset (A2:F17 in this example).
  2. Click the Abode tab.Home Tab in the Excel Ribbon
  3. In the Styles grouping, click on Conditional Formatting.Click on Conditional Formatting
  4. Click on 'New Rules'.Click on New Rule - Highlight Rows Based on a Cell Value in Excel (Conditional Formatting)
  5. In the 'New Formatting Rule' dialog box, click on 'Use a formula to determine which cells to format'.Use Formula Option to Highlight Rows based on cell value
  6. In the formula field, enter the following formula:=$C2="Bob"Specify the Formula to Highlight rows if it is True
  7. Click the 'Format' button.Click on the Format Button
  8. In the dialog box that opens, set the color in which you want the row to get highlighted.Color to Fill to highlight the rows
  9. Click OK.

This will highlight all the rows where the name of the Sales Rep is 'Bob'.

All rows where name is Bob are highlighted

Click here to download the Example file and follow forth.

How does it Work?

Conditional Formatting checks each cell for the condition we have specified, which is=$C2="Bob"

So when it's analyzing each cell in row A2, it will bank check whether the cell C2 has the name Bob or not. If it does, that cell gets highlighted, else it doesn't.

Notation that the pull a fast one on here is to use a dollar sign ($) before the cavalcade alphabet ($C1). By doing this, nosotros have locked the column to always be C. So even when cell A2 is existence checked for the formula, it will check C2, and when A3 is checked for the condition, information technology volition bank check C3.

This allows us to highlight the entire row by provisional formatting.

Related: Accented, Relative, and Mixed references in Excel.

Highlight Rows Based on a Number Criteria

In the above example, nosotros saw how to check for a name and highlight the unabridged row.

We tin can apply the same method to also check for numeric values and highlight rows based on a condition.

Suppose I have the aforementioned data (as shown below), and I want to highlight all the rows where the quantity is more than 15.

DataSet where you want to highlight rows where name is Bob

Hither are the steps to exercise this:

  1. Select the entire dataset (A2:F17 in this instance).
  2. Click the Abode tab.
  3. In the Styles group, click on Provisional Formatting.
  4. Click on 'New Rules'.
  5. In the 'New Formatting Rule' dialog box, click on 'Utilize a formula to determine which cells to format'.
  6. In the formula field, enter the following formula: =$D2>=15Formula to Highlight all Rows Based on a Number Criteria
  7. Click the 'Format' button. In the dialog box that opens, prepare the colour in which you lot desire the row to get highlighted.
  8. Click OK.

This will highlight all the rows where the quantity is more than than or equal to 15.

Resulting Data when Highlighting rows based on number criteria

Similarly, we can besides utilise this to have criteria for the date equally well.

For case, if you desire to highlight all the rows where the date is later 10 July 2018, you lot can use the below appointment formula:

=$A2>Engagement(2018,7,10)

Highlight Rows Based on a Multiple Criteria (AND/OR)

You tin also use multiple criteria to highlight rows using conditional formatting.

For case, if y'all want to highlight all the rows where the Sales Rep name is 'Bob' and the quantity is more than 10, yous can do that using the following steps:

  1. Select the entire dataset (A2:F17 in this example).
  2. Click the Home tab.
  3. In the Styles group, click on Conditional Formatting.
  4. Click on 'New Rules'.
  5. In the 'New Formatting Rule' dialog box, click on 'Use a formula to determine which cells to format'.
  6. In the formula field, enter the following formula: =AND($C2="Bob",$D2>x)Formula to Use Mutliple conditions when highlighting rows in Excel
  7. Click the 'Format' button. In the dialog box that opens, set the colour in which you want the row to get highlighted.
  8. Click OK.

In this example, only those rows get highlighted where both the conditions are met (this is done using the AND formula).

Result when rows are highlighted based on multiple conditions

Similarly, you tin too use the OR condition. For example, if you want to highlight rows where either the sales rep is Bob or the quantity is more than xv, you can use the below formula:

          =OR($C2="Bob",$D2>15)        

Click hither to download the Case file and follow along.

Highlight Rows in Different Color Based on Multiple Conditions

Sometimes, y'all may want to highlight rows in a color based on the condition.

For case, you may want to highlight all the rows where the quantity is more than than 20 in green and where the quantity is more than than fifteen (but less than 20) in orange.

To do this, yous need to create 2 provisional formatting rules and set the priority.

Here are the steps to exercise this:

  1. Select the unabridged dataset (A2:F17 in this example).
  2. Click the Home tab.
  3. In the Styles grouping, click on Conditional Formatting.
  4. Click on 'New Rules'.
  5. In the 'New Formatting Rule' dialog box, click on 'Utilise a formula to make up one's mind which cells to format'.
  6. In the formula field, enter the following formula: =$D2>15Formula to Highlight rows where value is more than 15
  7. Click the 'Format' button. In the dialog box that opens, prepare the color to Orangish.
  8. Click OK.
  9. In the 'Conditional Formatting Rules Manager' dialog box, click on 'New Rule'.Click on New Rule
  10. In the 'New Formatting Rule' dialog box, click on 'Use a formula to decide which cells to format'.
  11. In the formula field, enter the post-obit formula: =$D2>20Formula to Highlight rows where value is more than 20
  12. Click the 'Format' button. In the dialog box that opens, fix the colour to Greenish.
  13. Click OK.
  14. Click Apply (or OK).

The above steps would make all the rows with quantity more than 20 in light-green and those with more than 15 (only less than equal to 20 in orange).

Data where rows are highlighted in two colors

Agreement the Order of Rules:

When using multiple conditions, it important to make certain the order of the weather is correct.

In the above example, the Green color condition is above the Orange colour condition.

Order of Conditions when formatting rows

If it's the other fashion round, all the rows would be colored in orange merely.

Why?

Because a row where quantity is more than than 20 (say 23) satisfies both our atmospheric condition (=$D2>15 and =$D2>20). And since Orangish condition is at the height, it gets preference.

You can change the order of the conditions by using the Move Up/Down buttons.

Buttons to change the order of formatting

Click here to download the Example file and follow along.

Highlight Rows Where Whatsoever Cell is Blank

If you desire to highlight all rows where any of the cells in it is bare, you need to check for each prison cell using conditional formatting.

Here are the steps to do this:

  1. Select the entire dataset (A2:F17 in this example).
  2. Click the Home tab.
  3. In the Styles group, click on Conditional Formatting.
  4. Click on 'New Rules'.
  5. In the 'New Formatting Rule' dialog box, click on 'Use a formula to determine which cells to format'.
  6. In the formula field, enter the post-obit formula: =COUNTIF($A2:$F2,"")>0Using Countif to count blank rows
  7. Click the 'Format' button. In the dialog box that opens, ready the color to Orangish.
  8. Click OK.

The above formula counts the number of blank cells. If the result is more than 0, it ways there are blank cells in that row.

If whatsoever of the cells are empty, information technology highlights the unabridged row.

Highlighting Blank rows - Resulting Data

Related: Read this tutorial if you merely want to highlight the bare cells.

Highlight Rows Based on Drop Downwardly Selection

In the examples covered so far, all the weather were specified with the conditional formatting dialog box.

In this part of the tutorial, I volition show yous how to make it dynamic (and then that you tin can enter the condition within a cell in Excel and it will automatically highlight the rows based on it).

Below is an example, where I select a name from the driblet-down, and all the rows with that proper noun get highlighted:

Highlight Entire Row Based on Drop Down Selection

Hither are the steps to create this:

  1. Create adrop-down list in jail cell A2. Hither I take used the names of the sales rep to create the drib downward listing. Here is a detailed guide on how to create a drop-downwards list in Excel.
  2. Select the entire dataset (C2:H17 in this example).
  3. Click the Home tab.
  4. In the Styles group, click on Conditional Formatting.
  5. Click on 'New Rules'.
  6. In the 'New Formatting Rule' dialog box, click on 'Apply a formula to determine which cells to format'.
  7. In the formula field, enter the post-obit formula: =$E2=$A$2Rule to Highlight Cells that match the drop down value
  8. Click the 'Format' push. In the dialog box that opens, set up the colour to Orange.
  9. Click OK.

Now when you select whatsoever name from the drop-down, it volition automatically highlight the rows where the name is the aforementioned that you have selected from the drop-downwardly.

Interested in learning more on how to search and highlight in Excel? Check the below videos.

Yous May Likewise Like the Following Excel Tutorials:

  • Dynamic Excel Filter – Extracts Data equally you Type.
  • Create a drop-down list with a search suggestion.
  • How to Insert and Use a Checkbox in Excel.
  • Select Visible Cells in Excel.
  • Highlight Agile Row/Column in a Data Range.
  • Delete rows based on cell value in Excel
  • How to Delete Every Other Row in Excel
  • Apply Conditional Formatting Based on Another Cavalcade in Excel

Source: https://trumpexcel.com/highlight-rows-based-on-cell-value/

Posted by: pageothessonce.blogspot.com

0 Response to "How Do I Change The Color Of A Cell In Excel Based On Value?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel