How to highlight a row in a listview?

Microsoft Excel: How do I highlight rows based on value range/text of two different columns?

  • I have an excel file I would like to highlight a row based on the text in one column and a range of values in another column.  Basically, I want a row to be highlighted BLUE if the text in Column C says SALE and also the value of Column H is less than 1.00. But, if it Column C says SALE and Column H is over 1.00 I do not want it to do anything. Then if Column C does not say SALE and the value of Column H is less than 1.00 I want the row to highlight RED. I can figure out how to highlight a row but not based on two variables.  Please help!

  • Answer:

    Use Conditional Formatting Highlight the cells you want to be colored according to your specifications. Home > Conditional Formatting > New Rule... Rule Type: Use a formula to determine which cells to format Format values where this formula is true:    =AND($C2="SALE",$H2<1) Click on the Format button, go to the Fill tab and pick your color (my recommendation is to use subtle colors).  You'd want blue here. Click OK and OK again until you're back to the spreadsheet Ensure that it is working as expected. Repeat 1-7 for each additional formatting you want done. For your second request, #4:   =AND($C2<>"SALE",$H2<1) and #5 would be red. Here's an example I threw together:

Jason Hurley at Quora Visit the source

Was this solution helpful to you?

Other answers

I'm not big on conditional formatting, but here is my attempt: I broke it into two different conditional formatting rules. Blue Row Highlight for 'Sale' in C and >1 in H Select the columns you want to receive the highlighting, I chose A through H. On the ribbon under the Home section, select Conditional Formatting New Rule Use a formula to determine.... Enter =AND($C1="SALE", $H1>1) Click format Add formatting you want Click OK May have to go to Manage Rules and hit apply Red Row Highlight for not 'Sale' in C and < 1 in H Change Step 5 to =AND($C1<>"SALE", $H1<1,$H1<>"") (Note I added the last condition $H1<>"" so it wouldn't highlight all the blank lines.. it just says that the cell in H is not empty)

Chuck Lukowski

If you are using a Mac with Office 2011, these are the steps Step 1 Highlight all the cells you want to be color coded On the ribbon Home > Conditional Formatting > New Rule Change 'Style' to Classic Change 'Format only top or bottom ranked values' to 'Use formula to determine which cells to format' Enter this formula =AND($C2="SALE",$H2<1) Format with>Custom Color>Fill>Change color to Blue. Click ok. Step 2 Highlight all the cells you want to be color coded Home > Conditional Formatting > New Rule Change 'Style' to Classic Change 'Format only top or bottom ranked values' to 'Use formula to determine which cells to format' Formula =AND($C2<>"SALE",$H2<1 Format with>Custom Color>Fill in the tab bar>Change color to Red Click ok

Jason Schwartz

Diego M. Oppenheimer

I would do it in the following manner: Highlight the first row of your data. I'm assuming it is Row 2. Select Conditional Formatting -> New Rule Rule Type: Use a formula to determine which cells to format Enter in the formula =AND(TRIM($C2)="SALE",VALUE($H2)<1) Click on format and select fill color blue. Click OK twice Click Conditional Formatting -> Manage Rules (Do not change your selection before you do this) Click New Rule Rule Type: Use a formula to determine which cells to format Enter in the formula =AND(TRIM($C2)<>"SALE",VALUE($H2)<1) Click on format and select fill color red. Now ensure that the first rule you set is the top in the order. If it's not just select that rule and click the button with the up arrow in it. Now on both rules check the box that says "Stop if true". This will ensure that no additional styles are applied if multiple conditions happen to be true. Now replace the Applies to Range on both rules with your full data range. Let's say you have 10 rows of data starting at Row 2 the new applies to Range will be $2:$11. That should work. Let me know if you have any issues.

Sujeet Pillai

If you can replicate 's answer, then u'll be able to solve it. You can also refer this http://bit.ly/YCfDvw

Athar Ankalgi

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.