+ Reply to Thread
Results 1 to 15 of 15

Conditional formatting =AND

  1. #1
    Registered User
    Join Date
    12-09-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    10

    Conditional formatting =AND

    Good evening,

    I have 4 cells with drop down lists on sheet 1.
    On sheet 2, I have just the one cell with a drop down list.

    I am trying to use conditional formatting so that if any one of the four cells on sheet 1 match the cell on sheet 2, the cell on sheet 2 turns amber. However, whenever I use =AND, it requires all 4 cells to match the single cell on sheet 2.

    Is there any way around this?

    Thanks!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional formatting =AND

    Yes. Use OR.

    =AND(a, b, c, d)
    This expression is true when a AND b AND c AND d are all true.

    =OR(a, b, c, d)
    This expression is true when any one (or more) of a OR b OR c OR d are true.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    12-09-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    10

    Re: Conditional formatting =AND

    When I use =OR, the cell on sheet 2 changes colour without the cells on both sheets having a matching value. So for example, =OR(Mon!$N$4,Mon!$S$4,Mon!$N$12="WORKLOAD",$N$12="WORKLOAD")
    So Mon is sheet 1 and the three cells following Mon are the cells that I want to match with cell N12 on sheet 2. So if any of the three cells on sheet 1 have WORKLOAD in it, as well as the cell from sheet 2, then the cell on sheet 2 should change colour.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Conditional formatting =AND

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-09-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    10

    Re: Conditional formatting =AND

    That kind of works, I don't think I am explaining it very well.

    So I have essentially have three sheets.

    On all three sheets there are 4 cells. Each cell has a dropdown list.

    On the third sheet, I want to put in conditional formatting on one of the cells. I want it to look for matching text from the four cells on sheets 1, 2 and 3. If say "WORKLOAD" is in cell A1 on sheet 1 and B1 on sheet 2 and it was also to say "WORKLOAD" on sheet 3 in cell C5, I want it to recognise that and colour the cell of sheet 3 a different colour. But, only if there is matching text between the four cells on both sheet 1, 2 and 3.

    Does that make sense?

    I have tried =MATCH as well but that only seems to work for two matching values not three :/

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Conditional formatting =AND

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional formatting =AND

    Quote Originally Posted by t1o9n9y1 View Post
    If say "WORKLOAD" is in cell A1 on sheet 1 and B1 on sheet 2 and it was also to say "WORKLOAD" on sheet 3 in cell C5, I want it to recognise that and colour the cell of sheet 3 a different colour. But, only if there is matching text between the four cells on both sheet 1, 2 and 3.

    Does that make sense?
    No, because in your first post you said
    I am trying to use conditional formatting so that if any one of the four cells on sheet 1 match the cell on sheet 2, the cell on sheet 2 turns amber. However, whenever I use =AND, it requires all 4 cells to match the single cell on sheet 2.
    Having the file will help, but it only if we understand what you want to do.

  8. #8
    Registered User
    Join Date
    12-09-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    10

    Re: Conditional formatting =AND

    I have attached the file.

    So there are five sheets, each representing a different day.

    In cells, N4, N12, S4, S12 and AJ8, there are dropdown lists with 11 names.

    If on Sheet 1, a name appears in any of those cells and then on Sheet 2 the same name
    appears in any of those cells, using =MATCH and conditional formatting I have got the
    names to flag up with a yellow fill.

    However, where I am stuck is, if on the third sheet, the same name appears yet again in
    any of those cells, so the same name over three sheets, I want the name to flag up with a red fill.

    Sorry that my explanations have been pretty shoddy. I am not the best at explaining
    things and I was trying to keep names and things out of the post. Thanks anyway.
    Attached Files Attached Files
    Last edited by t1o9n9y1; 03-16-2021 at 10:23 AM.

  9. #9
    Registered User
    Join Date
    12-09-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    10

    Re: Conditional formatting =AND

    Has anyone figured this out? Or can Excel not perform that function?

    Thanks!

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Conditional formatting =AND

    I don't touch merged cells, so I'm out.

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional formatting =AND

    This can certainly be done. I am going to restate your problem to make sure I understand.

    First, you are talking about the first three sheets, but you have five sheets. You talk about "If on Sheet 1...then on Sheet 2...if on the third sheet" and then "the same name over three sheets" But do you really mean the same name over the first three sheets, or any three sheets?

    Here is what I think you want:

    1. Every sheet has the following cells that can contain a name: N4, N12, S4, S12 and AJ8
    2. If the same name appears in any of those cells on at least three sheets, then highlight the name in red. It does not have to be the same cell on all sheets.

    This is a bit of a challenge since it's a discontinuous range spread across several sheets. To solve these I have created a new sheet to do the heavy lifting, and conditional formatting refers to it. This sheet has formulas that count how many times each name occurs on all sheets.

    I would highly recommend that you create a list of names somewhere and refer to that instead of typing out the list in each data validation rule. It will make it so much easier if you ever have to change that list.

    Also, you are using a lot of merged cells which is usually a bad idea and makes all of this much harder.

    Also I have not reviewed your existing conditional formatting rules but I suspect this is a very complicated solution that will be a nightmare if you ever have to change anything. I recommend redesigning your entire solution.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-09-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    10

    Re: Conditional formatting =AND

    Thanks so much 6StringJazzer, you have been extremely helpful.

    Yeah that's exactly what I wanted. So if the same name appears over 3 consecutive sheets/days, so Mon, Tue & Wed or Tue, Wed & Thu, or Wed, Thu & Fri it flags up as red.

    I wasn't aware about merged cells being difficult to work with. Thanks so much for the tip. I'll avoid doing that in the future.

    Well my existing conditional formatting rules are based on 2 consecutive sheets/days, in which case it flags up as yellow. I just used the =MATCH formula. It seems to work okay. Would you recommend creating a list somewhere else for that also?

    Again, thanks for your continued help with this matter.

  13. #13
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional formatting =AND

    Quote Originally Posted by t1o9n9y1 View Post
    So if the same name appears over 3 consecutive sheets/days, so Mon, Tue & Wed or Tue, Wed & Thu, or Wed, Thu & Fri it flags up as red.
    Well, no, that's not what I did. That's why I tried to explain back what I thought you wanted. If you need consecutive sheets, it needs a change. The good news is that the way I did it makes it easy to change.

  14. #14
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Conditional formatting =AND

    Update attached.

    I'll give some thought to your rule for yellow. It works fine but if you ever have to update the names it's going to be a headache.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    12-09-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    10

    Re: Conditional formatting =AND

    Oh brilliant. Thanks again. You have been so helpful.

+ 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