I am trying to apply background color to a range of cells if two conditions are true. I have resorted to formatting each cell in the range with the same "formula is" conditional format. My formula is =IF(AND($A$3>100),($I$3>2%)) I get no errors but the cell is formatted even if both conditions are false. Any help?
You don't need the IF( ). All you need is the AND(cond1, cond2)
---------------------------------------------------
ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
To insert code into the VBE (Visual Basic Editor)
- Copy the code.
- Open workbook to paste code into.
- Right click any worksheet tab, select View Code
- VBE (Visual Basic Editor) opens to that sheets object
- You may change to another sheets object or the This Workbook object by double clicking it in the Project window
- In the blank space below the word "General" paste the copied code.
Watch your parentheses:
Either:
=IF(AND(($A$3>100),($I$3>2%)),TRUE)
or
=AND(($A$3>100),($I$3>2%))
or
=AND($A$3>100,$I$3>2%)
DarrenMPY wrote:
>
> I am trying to apply background color to a range of cells if two
> conditions are true. I have resorted to formatting each cell in the
> range with the same "formula is" conditional format. My formula is
> =IF(AND($A$3>100),($I$3>2%)) I get no errors but the cell is formatted
> even if both conditions are false. Any help?
>
> --
> DarrenMPY
> ------------------------------------------------------------------------
> DarrenMPY's Profile: http://www.excelforum.com/member.php...o&userid=36787
> View this thread: http://www.excelforum.com/showthread...hreadid=565433
--
Dave Peterson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks