• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Conditional Formatting based on True/False outcome of IF formula

MHudson

New Member
Simple issue which I believe will have a simple answer, but I cannot figure it out for the life of me.

I have an IF formula in a cell, I need to have the cell conditionally formatted green if the result of the IF formula is TRUE, and red if the result of the IF formula is false. Any Ideas?
 
@MHudson What might be tricking you as it still catches me at times is even though you are putting in the logic of an IF statement, in CF it's a little different in that it only wants to know what to do if the result is TRUE as it will ignore the FALSE. So enter =A1="YES" into the 1st condition formula in CF, conditioned as green, (not =IF(A1="Yes" as you would reasonably think). Then the 2nd condition =A1<>"Yes" conditioned as red. Basically each condition wants to know what to do if it encounters a TRUE result to trigger the conditional formatting. You can test these outside of CF in a normal cell formula and if you can't get a TRUE or you get an error CF will fail. Hope this helps.
 
To expand on what John said, if the result of the cell is already a TRUE/FALSE output, your CF rules would be:

=A1

Format green

=NOT(A1)

Format red
 
Awesome stuff guys...John, it worked exactly as you typed it out, always love that! Now how do I go about altering the formulas if I want to apply each condition to a table of cells?


Thanks again!!!
 
As long as you don't use absolute references in your formulas, you should be able to copy the formatting to the other cells in table.


or


Select the entire table of cells to format, take notice of which cell is active, (say, C3), and then just write the CF formula with respect to c2, eg:

=C3="Yes"
 
Back
Top