• 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.

Conditionial formatting

brems

Member
Hi,

I have a file with some hard-coded conditional formatting. I attached an example.

The conditions for formatting the cells are hard-coded in the conditional formatting itself but I want to have the possibility to have the conditions refer to the cells C2, C3 and C4.
I know this is possible when I remove the operators from the specific cells but I wonder if a relative conditional formatting is possible with the operators (<>=) still in the specific cell.

If for example cell C2 is changed to <90% the conditional format is applied to the range A1:A20.

Thank you for having a look at my question.
 

Attachments

  • cond format.xlsx
    9.3 KB · Views: 11
Last edited:
As far as I know, nope can't have logical operators within a cell as criteria for conditional formats. The symbols must be in the formulas but values can be cell references. Example attached.
 

Attachments

  • Copy of cond format.xlsx
    11.3 KB · Views: 4
Hi brems,

Check these (using chirayu's approach)

for C2 (> = 90%)
=COUNTIF(A1,SUBSTITUTE(C$2," ",""))

for C3 (> = 80% en < 90%)
=AND(COUNTIF(A1,SUBSTITUTE(LEFT(SUBSTITUTE(C$3," ",""),FIND("%",SUBSTITUTE(C$3," ","")))," ","")),COUNTIF(A1,MID(SUBSTITUTE(C$3," ",""),FIND("<",SUBSTITUTE(C$3," ","")),LEN(C$3))))

for C4 (< 80%)
=COUNTIF(A1,SUBSTITUTE(C$4," ",""))

Regards,

PS: @chirayu, IF not necessary :)
 
I have done this using helper columns. See if this logic serves your purpose.
 

Attachments

  • Variable Conditional Formatting.xlsx
    9.8 KB · Views: 5
Hi chirayu, Khalid and Badale,

Thank you very much for the offered solutions. They sure meet my requirement and the offered solutions are very inspirational on approaching and solving Excel challenges!

Thanks again.
Brems
 
Back
Top