+ Reply to Thread
Results 1 to 5 of 5

Using COUNTIF for split ranges

  1. #1
    Registered User
    Join Date
    05-22-2008
    Posts
    22

    Using COUNTIF for split ranges

    REGION: USA
    EXCEL VERSION: 2013
    MERGED CELLS: FALSE

    The formula below used to calculate work strength each operational work day. If/when an employee calls in sick (SICK), is out for training (TR), or on Vacation (V), the use of that option will reduce the total employee count for that day by one (1). However, on rare occasion, an employee may go to a training event on their day off, and thus if the training code "TR" is used, it will reduce from the employee work strength when it really would not impact the work strength as they were already off.

    PROBLEM:
    I need to be able to use the following formula to count for a split range of cells

    =SUM(COUNTIF(AC7:AC33,{"OJI","SICK","ML","AL","PL","FH","V","FL","FMLA","OIC","HOS","DO","OP","TR"})*{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1})+AP68

    Expected result: To have this formula function for two ranges of cells in the same column. AC7:AC20 and AC28:AC33

    Thank you for any help you can offer

    AEROICA

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Using COUNTIF for split ranges

    Is this work?

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

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Using COUNTIF for split ranges

    Pl upload a sample file how you differentiate on training on duty or on day off.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Registered User
    Join Date
    05-22-2008
    Posts
    22

    Re: Using COUNTIF for split ranges

    Quote Originally Posted by Bo_Ry View Post
    Is this work?

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hello and thank you so much! This worked perfectly!

    I actually tried a version of this but still had the "+AP68" at the back end of the formula. I don't understand why being at the front end would make a difference. Is this because once a condition is met, it stops calculating? If so, I thought that only applied to IF statements. Just really curious why putting the final calculation at the beginning made it work. I would not have thought to relocate that part of it. Nice job!

    I also noticed that you didn't have to have the reduction of -1 for each choice. That is so nice, I thought you had to have the value specified. That's so much cleaner!

    Thank you very much again!
    Last edited by Aeroica; 11-23-2018 at 06:15 PM.

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Using COUNTIF for split ranges

    Hi Aeroica,

    Thanks for the rep.

    I haven't try but put "+AP68" at the back should give the same result.

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



    If this takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Split GB Postcode ranges in to rows!!!!
    By 2013boris in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-11-2013, 12:31 PM
  2. [SOLVED] Split postcode ranges into rows
    By 2013boris in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2013, 09:41 AM
  3. Split the ranges into column vales
    By SakshiTandon in forum Excel General
    Replies: 3
    Last Post: 02-02-2013, 06:31 AM
  4. split data into ranges
    By mmandel in forum Excel General
    Replies: 6
    Last Post: 10-23-2012, 06:16 AM
  5. Building macro to split out ranges
    By Culvernator in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2011, 05:47 PM
  6. Excel 2007 : Trying to split number into ranges
    By daveydet in forum Excel General
    Replies: 2
    Last Post: 11-02-2010, 01:54 PM
  7. [SOLVED] how to split data in a range to many ranges
    By Paul in forum Excel General
    Replies: 2
    Last Post: 02-20-2005, 12:06 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