+ Reply to Thread
Results 1 to 12 of 12

Conditional Formatting not working?

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Conditional Formatting not working?

    Hello Everyone,

    I have made a sheet that contains conditional formatting that changes when a condition is met but it is not working for some reason when the cells have equal values?
    Below is the description:

    Cell Y25 contains the following formula:
    =(E25*F25+SUM(H25:X25)) this produces: $801.75

    Cell Z25 contains the following formula:
    =IF(Y25<>AA25,"O","X")

    And the following conditional formatting is also in cell Z25:
    Condition1
    Cell Value Is - equal to - ="X" (Change cell color to green)

    Condition2
    Cell Value Is - equal to - ="O" (Change cell color to red)

    I then type $801:75 into cell AA25 but cell Z25 stays as a red X! It should turn to a green O because cells Y25 and AA25 both have the same value of $801.75!
    I have no idea why but have checked the cell formatting and it is the same in both cells Y25 and AA25?

    Thank you for any help.

    Margate

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,749

    Re: Conditional Formatting not working?

    does the cell change from O to X ok
    can we see a spreadsheet attached

    you may try using a formula input

    Z25 = "O" - red

    Z25 = "X" - green

    OR

  3. #3
    Registered User
    Join Date
    01-28-2013
    Location
    Coventry
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Conditional Formatting not working?

    just looking quickly at this, it seems you have Z25 formula the wrong way round.

    atm, when Y25 DOES NOT EQUAL AA25, show O, otherwise show X
    P.S. surely is would be easier to put =if(Y25=AA25,"O","X")

  4. #4
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Conditional Formatting not working?

    Hello a8015945,
    I have changed the formula to your suggestion =if(Y25=AA25,"O","X") and now Z25 turns into a green X but not a red O when Y25 is not equal to AA25.

    Unfortunately I am unable to upload the sheet because I am on a works computer!

    Thank you for your help.

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,749

    Re: Conditional Formatting not working?

    does the cell Z25 change to an X and and O correctly ?

    you would needtwo conditions in the format
    one for red and one for green

    so as a formula

    =Y25=AA25 - RED
    =Y25<>AA25 - Green

    or as i posted

    your original formula in
    Z25 was
    =IF(Y25<>AA25,"O","X") -
    which is different

    =Y25=AA25 - Green - "X"
    =Y25<>AA25 - Red - "O"

    I have added a spreadsheet - which uses the value in Z25 as an O or as an X to conditional format and change colour
    Attached Files Attached Files
    Last edited by etaf; 04-30-2013 at 10:56 AM.

  6. #6
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Conditional Formatting not working?

    Hello a8015945,
    I have changed the formula to your suggestion =if(Y25=AA25,"O","X") and now Z25 turns into a green X but not a red O when Y25 is not equal to AA25.

    Unfortunately I am unable to upload the sheet because I am on a works computer!

    Thank you for your help.

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Conditional Formatting not working?

    I reckon Y25 and AA25 have different values in them-try increasing the number of decimal places to check that. you can also change the formula to
    =IF(round(Y25,2)<>round(AA25,2),"O","X")
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  8. #8
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Conditional Formatting not working?

    Hello etaf,

    the cell does not change to an X or a O no!
    I have two conditions in the conditional formatting yes one red for the O and one green for the X.
    If I type in an X or a O (overwriting the formula) then the cells turns color accordingly indicating that the conditional formatting is working as it should do. The problem appears to be within the formulas but I do not understand where!

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,749

    Re: Conditional Formatting not working?

    i have edited my post and added the example

    As JosephP replied, looks like your formula maybe correct - but the values not actually equal and so check the decimal places
    and apply the round as suggested

  10. #10
    Registered User
    Join Date
    01-28-2013
    Location
    Coventry
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Conditional Formatting not working?

    OK i think I've solved it.

    I think what you need to do is compare Y25 and AA25 as a conditional format, instead of looking for O or X.
    By this i mean, select Z25, conditional formatting -> new rule -> use a formula -> =($Y$25=$AA$25) --- Green
    Then do the same for red, select Z25, new rule -> use a formula -> =($Y$25<>$AA$25) --- Red

    You can still use an IF statement in Z25 to show O or X, but now the formatting looks at the two cells (Y25 and AA25)

  11. #11
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,749

    Re: Conditional Formatting not working?

    a8015945 both ways should work - the O and X and the formulas

    its more likely the decimal issue, as replied by JosephP , as the formula for putting an O or an X does not work, nor will using the same formulas for a cond frmt

  12. #12
    Registered User
    Join Date
    01-28-2013
    Location
    Coventry
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Conditional Formatting not working?

    @Margate

    Ive just read your message again, when you say you enter $801.75, do you type the dollar sign in too ?

    EDIT

    excel auto selects it as currency
    Last edited by a8015945; 04-30-2013 at 11:34 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1