+ Reply to Thread
Results 1 to 6 of 6

If... and... or checking multiple columns

  1. #1
    Registered User
    Join Date
    07-05-2022
    Location
    UK
    MS-Off Ver
    2016
    Posts
    9

    If... and... or checking multiple columns

    I have an employee timesheet on a worksheet. Each day is split into two columns (AM and PM).
    Column A has employee names

    Column B is the first day (e.g. Monday) AM shift
    Column C is the PM shift
    Each AM or PM shift could be represented by the following inputs which are conditionally formatted.
    S Sick
    AL Annual Leave
    ** (Any other input means shift worked)
    (no input means shift not worked/day off/do not count etc.
    Column D requires a function to check for Sick input "S" in either B or C, returning 1 if both columns are "S", 0.5 if one of the columns is "S" or 0 if neither column has "S"
    Column E requires a function to check for Annual Leave input "AL" again showing as 1, 0.5 or 0
    Column F requires a function to check for any other input, again showing as 1, 0.5 or 0

    If column D has a value of 1, columns E and F cannot have a value at all and so forth...
    If column D has a value of 0.5, columns E and F can only have a maximum value of 0.5...
    The value of D, E and F has to be a maximum of 1.

    I need three functions to handle the input options. I think each function has to handle either "S"; "AL"; "**" and "".

    Any help would be much appreciated.
    Attached Files Attached Files
    Last edited by ady73; 07-13-2022 at 03:46 AM.

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

    Re: If... and... or checking multiple columns

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

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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
    Registered User
    Join Date
    07-05-2022
    Location
    UK
    MS-Off Ver
    2016
    Posts
    9

    Re: If... and... or checking multiple columns

    Thanks - have added sample timesheet to original post

  4. #4
    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,497

    Re: If... and... or checking multiple columns

    You have given us a completely empty table:

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    C
    D
    E
    F
    1
    Monday
    11-Jul
    2
    AM PM Sick Leave Worked
    3
    John
    4
    Mary
    Sheet: Sheet1

    I asked for this:

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.

  5. #5
    Registered User
    Join Date
    07-05-2022
    Location
    UK
    MS-Off Ver
    2016
    Posts
    9

    Re: If... and... or checking multiple columns

    Hi - have uploaded a replacement workbook to #1. I have some limited experience with 'If And' and 'If Or' functions but nesting multiple scenarios as I would require here is proving beyond my ability.
    Thank you for your help.
    Last edited by ady73; 07-13-2022 at 03:49 AM.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,536

    Re: If... and... or checking multiple columns

    The following yield the results that are shown in the workbook attached to post #1:
    For D3 and down: =COUNTIFS(B3:C3,"s")*0.5
    For E3 and down: =COUNTIFS(B3:C3,"al")*0.5
    For F3 and down: =COUNTIFS(B3:C3,"<>",B3:C3,"<>S",B3:C3,"<>al")*0.5
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] COUNTIF with an OR Statement - Checking multiple columns for a value
    By mason0567 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-23-2019, 05:48 PM
  2. Checking multiple columns using IFERROR
    By cwelsh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-24-2018, 09:58 PM
  3. Checking multiple criteria and select data over multiple columns
    By jy677 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-25-2013, 09:38 PM
  4. Help with moving multiple columns and checking alignment
    By TheMegs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2012, 05:54 PM
  5. Vlookup checking multiple columns
    By caippers in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-06-2010, 12:23 PM
  6. Checking Multiple Values Against Multiple Columns
    By Maglor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-22-2009, 08:40 PM
  7. Checking for a zero value in multiple columns
    By johnsoned in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-14-2005, 08:30 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