Conditional Formatting with a Vlookup formula

Rosstamon

Board Regular
Joined
Sep 12, 2007
Messages
77
Hello,
I have a spreadsheet with 36 rows of data in columns F – I, rows 2 – 36, and row 1 is the header info.
Column F has alphabetical symbols.
Column I contains numbers expressed as percentages.

I would like to be able to do the following:
If column F contains alphabetical symbol “ANDI”, highlight the entire line (F – I) grey. This could be row 18 this time, and row 22 next time and could always change. I believe this conditional formula would look like this:
=$F2="ANDI", then custom format grey and apply it to $F$2:$I$36

Here's where it gets tricky for me, I would like the remaining conditional formatting to do the following for column I in each row:

"if the number in column I, in each row is greater than column I of the row that contains the symbol "ANDI", then highlight the number green.

"if the number in column I, in each row is less than the number in column I of the row that contains the symbol "ANDI”, then highlight the number red.

I'm stuck and would appreciate any help. I’m dreadfully awful at VBA, so I don’t think that would work for me.

I've attached an example of what it would look like before and after conditional formatting.

Thank you
 

Attachments

  • For MrExcel-1.jpg
    For MrExcel-1.jpg
    80.2 KB · Views: 18
  • For MrExcel-2.jpg
    For MrExcel-2.jpg
    77.5 KB · Views: 18

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Assuming that "ANDI" is only found once in column F, use this for green rule, change > to < for red rule.
Excel Formula:
=$I2>SUMIF($F$2:$F$36,"ANDI",$I$2:$I$36)
 
Upvote 0
Assuming that "ANDI" is only found once in column F, use this for green rule, change > to < for red rule.
Excel Formula:
=$I2>SUMIF($F$2:$F$36,"ANDI",$I$2:$I$36)
I appreciate the help, it didn't work. Also, I just realized I kept using "I" where I should have been using "J", so I changed your formulas as follows, but it still didn't work:
=$J2<SUMIF($F$2:$F$36,"ANDI",$J$2:$J$36) and the custom is fill red.
=$J2>SUMIF($F$2:$F$36,"ANDI",$J$2:$J$36) and the custom fill is green.

The result is the following.

Any other ideas.
I really appreciate your help. Would love to get this working right.
Thanks again.


***EDIT***
Your formulas are exactly correct, I also needed to change "F" to "G". I apologize. I must have had it as "F - I" originally, and moved it over one column at some point. At any rate, your suggestion made it work once I got my targets corrected. Thank you so much.
 

Attachments

  • For MrExcel-3.jpg
    For MrExcel-3.jpg
    85.9 KB · Views: 12
Last edited:
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top