Conditional format, variable rows and columns

•Daniel•

New Member
Joined
Jun 5, 2009
Messages
43
Hello I have this formula for conditional formatting to highlight a row:

Code:
=AND(OR(COUNTIF($D$5:$F$8,$D5:$F5)>=2),$G5<>0)

If any of the values on the row is reapeatead in the range and another condition is true then highlight the row, the thing is I only know where the range begins, the end column and the end rows are variable, I can store them in variables but don't know how to put the columns variable in:

Code:
=AND(OR(COUNTIF($D$5:$[B]F[/B]$" & x & ",$D5:$[B]F[/B]5)>=2),$[B]G[/B]5<>0)

How can I put this "formula1:=" in r1c1 style?,

thx
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

pbornemeier

Well-known Member
Joined
May 24, 2005
Messages
3,903
I made a named range (named LX) and use this:
=AND(OR(COUNTIF(INDIRECT("$D$5:$F$" & LX),$D5:$F5)>=2),$G5<>0)

A quick way to get the R1C1 version of a formula is to turn on the macro recorder, click in the cell to edit it, press return.
"=AND(OR(COUNTIF(INDIRECT(""$D$5:$F$"" & LX),R[4]C4:R[4]C6)>=2),R[4]C7<>0)"
 
Solution

Forum statistics

Threads
1,181,963
Messages
5,932,986
Members
436,871
Latest member
Nickytoo

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
Top