+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting formula to highlight a column if multiple criteria are not met.

  1. #1
    Registered User
    Join Date
    08-15-2018
    Location
    Saskatchewan, Canada
    MS-Off Ver
    Office 2019
    Posts
    21

    Conditional Formatting formula to highlight a column if multiple criteria are not met.

    Hi,

    I'm working on a work schedule spreadsheet for my place of employment. We have 4 people working each day on 2 shifts. (2 people on shift 1 and 2 people on shift 2). I am trying to figure out a formula to highlight (conditional format) the column for a given day if the scheldule is not correct. I kinda figured it out using the following formula =SUM(COUNTIFS(B3:B16,{"1","2"})). This does work if there is too many or not enough people working. But it dosesn't if there are 3 people put on shift 1 and one person put on shift 2. I provided a screenshot of what I'm trying to do, so hopefully, it shows up. Basically, I need a formula so that if cells B3:B15 don't have 2 cells that contain just the number "1" and 2 other cells that contain just the number "2" format it red. I've been working trying to figure this out for a while so any help anyone can offer would be greatly appreciated.

    Thanks and have a great day!
    Attached Images Attached Images

  2. #2
    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,938

    Re: Conditional Formatting formula to highlight a column if multiple criteria are not met.

    Hi, welcome to the forum

    Always better to include a file, instead of a pic.

    1st, how do you ID which shift is being worked?
    2nd I "think" what you need to do is countif() for each shift, something like...
    and(countif(range, S1 indicator)=2,countif(range, S2 indicator)=2)

    (CF only needs a T or F response)
    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

  3. #3
    Registered User
    Join Date
    08-15-2018
    Location
    Saskatchewan, Canada
    MS-Off Ver
    Office 2019
    Posts
    21

    Re: Conditional Formatting formula to highlight a column if multiple criteria are not met.

    Sorry, I never even thought of posting the actual file. That would probably make it easier for someone to figure out. Here it is.

    To answer your question. Shifts are identified as a 1 or a 2 on the schedule. 1 being shift 1 and 2 being shift 2. So the 2 employees with a 1 are working together and the 2 employees with a 2 are working together for a given day of the month.

    Thanks
    Attached Files Attached Files
    Last edited by KMJ256388; 08-15-2018 at 02:42 AM.

  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,938

    Re: Conditional Formatting formula to highlight a column if multiple criteria are not met.

    1st, highlight the entire range, then try this as your CF rule...
    =OR(COUNTIF(B$3:B$15,1)<>2,COUNTIF(B$3:B$15,2)<>2)

    Note that this will not take into account any 1H or 2H

  5. #5
    Registered User
    Join Date
    08-15-2018
    Location
    Saskatchewan, Canada
    MS-Off Ver
    Office 2019
    Posts
    21

    Re: Conditional Formatting formula to highlight a column if multiple criteria are not met.

    FDibbins, thank you so much! This formula works perfectly and was exactly what I was looking to do. I'm not that good with formulas, but now I see the correct formula it makes sense. Your assisstance is greatly appreciated!

  6. #6
    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,869

    Re: Conditional Formatting formula to highlight a column if multiple criteria are not met.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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.

+ 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 on column based on multiple Text criteria
    By Rellsunn in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-22-2017, 12:38 PM
  2. Replies: 1
    Last Post: 06-09-2016, 11:38 AM
  3. [SOLVED] Vlookup formula to select and highlight (conditional formatting) multiple results
    By hbomb1927 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-20-2014, 03:27 PM
  4. Replies: 5
    Last Post: 11-08-2013, 05:57 AM
  5. [SOLVED] Formula for Multiple Criteria in Conditional Formatting
    By excelheaven in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-08-2013, 10:52 PM
  6. Replies: 5
    Last Post: 09-24-2012, 05:14 PM
  7. Conditional formatting highlight criteria
    By mcmuney in forum Excel General
    Replies: 9
    Last Post: 05-23-2011, 06:37 PM

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