+ Reply to Thread
Results 1 to 17 of 17

Conditional formatting and/or

  1. #1
    Registered User
    Join Date
    07-16-2018
    Location
    Australia
    MS-Off Ver
    Microsoft Office Plus 2016
    Posts
    21

    Conditional formatting and/or

    Hi all,

    This is probably a really obvious one but I can't seem to get it right with the slight differences in code with conditional formatting.

    I currently use
    =IF($C$2="Apple",ISBLANK($D$24))

    Which works fine and will colour the cell if C2 = Apple and D24 is blank

    What I need is the cell conditioning to trigger if C2 = Apple OR Orange and D24 is blank

    Any ideas?

    Thanks in advance and as always
    Last edited by Nevski79; 07-29-2021 at 09:16 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: Conditional formatting and/or

    Try this:

    =AND(OR($C$2="Apple",$C$2="Orange"),ISBLANK($D$24))

    You don't need IF in a conditional formatting rule, and I don't think your original formula is really doing what you think it is, anyway. Unless, of course, you man something entirely different.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional formatting and/or

    Not sure that is working the way you think it is, but OK.

    Try this...
    =and(or(C2="Apple",C2="Orange"),D24'"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional formatting and/or

    Must be an echo in here...here.... lol

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional formatting and/or

    oops left out an =....
    =and(or(C2="Apple",C2="Orange"),D24="")

  6. #6
    Registered User
    Join Date
    07-16-2018
    Location
    Australia
    MS-Off Ver
    Microsoft Office Plus 2016
    Posts
    21

    Re: Conditional formatting and/or

    Thanks all, I should mention, the reason I have ISBLANK is I want the formatting to trigger only if Apple/Orange is selected via dropdown and D24 is blank. Basically it's a subtle queue for a cell to be filled out and if it isn't the cell background colour is red. If the cell isn't blank, I want all formatting to be removed.
    Last edited by Nevski79; 07-29-2021 at 03:00 AM.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: Conditional formatting and/or

    Do I look like a gent???

    I don't quite get what you are saying. Provide a sample workbook to illustrate this.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional formatting and/or

    ISBLANK and ="" are basically the same thing

    There is nothing magical about a drop down (data validation), it acts in the exact same way as if you had entered the data manually, and excel formulas only see the data in the cell as if it had been entered manually.

    The only real advantages of using a DD is that it saves typing, avoids typos/spelling mistakes, restricts entry to what you specify, and maybe saves a bit of time in entering data.
    Other than that, no difference to manual entry

  9. #9
    Registered User
    Join Date
    07-16-2018
    Location
    Australia
    MS-Off Ver
    Microsoft Office Plus 2016
    Posts
    21

    Re: Conditional formatting and/or

    Quote Originally Posted by AliGW View Post
    Do I look like a gent???

    I don't quite get what you are saying. Provide a sample workbook to illustrate this.
    lol I was hoping I edited my response in time! my bad!

    Here's what I need:
    Apple is selected from B2 and C2 is empty - trigger cell formatting
    Orange is selected from B2 and C2 is empty - trigger cell formatting
    Banana is selected from B2 and C2 is empty - no cell formatting
    Any stage any text is entered into C2 - no cell formatting

    For some reason it's not letting me attach a file :/

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional formatting and/or

    Did you try the suggested CF rules yet? they should do exactly what you want.
    =and(or(C2="Apple",C2="Orange"),D24="")

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: Conditional formatting and/or

    There are instructions at the top of the page explaining how to attach your sample workbook.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional formatting and/or

    I see this is now marked as SOLVED? Did you try the suggestions?

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: Conditional formatting and/or

    Another hit and run, Ford.

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Conditional formatting and/or

    Apparently so, Ali

  15. #15
    Registered User
    Join Date
    07-16-2018
    Location
    Australia
    MS-Off Ver
    Microsoft Office Plus 2016
    Posts
    21

    Re: Conditional formatting and/or

    I'm really making a good impression here aren't I? lol. Not my intent!

    Thankyou to all for your support and answers. I appreciate you!

  16. #16
    Registered User
    Join Date
    07-16-2018
    Location
    Australia
    MS-Off Ver
    Microsoft Office Plus 2016
    Posts
    21

    Re: Conditional formatting and/or

    Quote Originally Posted by FDibbins View Post
    I see this is now marked as SOLVED? Did you try the suggestions?
    It is and thankyou! I was able to get it working with the code AliGW provided.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: Conditional formatting and/or

    Thanks - appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Conditional Formatting based on another cells Conditional Formatting
    By chriskay in forum Excel General
    Replies: 4
    Last Post: 08-22-2019, 05:33 AM
  2. [SOLVED] Override conditional formatting (in general, without changing the conditional formatting)
    By Stormin' in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2017, 07:15 AM
  3. Conditional Formatting Removing Previous Conditional Formatting?
    By CravingGod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2016, 01:02 PM
  4. Replies: 6
    Last Post: 01-08-2016, 06:44 PM
  5. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  6. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  7. Replies: 3
    Last Post: 05-15-2012, 04:13 PM

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