+ Reply to Thread
Results 1 to 21 of 21

Counting occurences

  1. #1
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Counting occurences

    Hi All.

    I'm running into a problem I don't know how to solve. I have set up a monthly chart to track when employees call in sick or other activities (ex. Holidays, etc...), However counting sick occurrences is proving tricky. The COUNTIF statement isn't the problem, its trying to get excel to understand what an occurrences is. If an employee calls in sick for three consecutive days, that is one occurrence. However if an employee calls in sick on Monday, back to work on Tuesday, calls in sick on Wednesday, back to work on Thursday, and calls in sick on Friday, that is 3 occurrences. How do I get excel to handle that?

    Thank you for any help you can provide
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    One other question. If I mark down a person used 4 hours of sick time as S4, how do I count this as an "S" with a COUNTIF?

  3. #3
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    Using the wildcard search I'm using the following formula:

    COUNTIFS(C8:BL9,"S*",C12:BL13,"S*",C16:BL17,"S*",C20:BL21,"S*",C24:BL25,"S*",C28:BL29,"S*",C32:BL33,"S*",C36:BL37,"S*",C40:BL41,"S*",C44:BL45,"S*",C48:BL49,"S*",C52:BL53,"S*")

    However I keep coming up with a total of Zero. Any help is appreciated. Thank you

  4. #4
    Registered User
    Join Date
    09-25-2015
    Location
    Phnom Penh, Cambodia
    MS-Off Ver
    2013, 2010
    Posts
    20

    Re: Counting occurences

    RickMcc,

    In this case you can use =COUNTIF(range,"S*")
    Last edited by jeffreybrown; 03-13-2018 at 09:49 PM. Reason: Removed full quote!

  5. #5
    Registered User
    Join Date
    09-25-2015
    Location
    Phnom Penh, Cambodia
    MS-Off Ver
    2013, 2010
    Posts
    20

    Re: Counting occurences

    RickMcc,

    in this case you can use the following:

    =COUNTIF(C48:BK48,"S*")+COUNTIF(C52:BK52,"S*")+....

    When you use "countifs" Ms Excel will consider it as 2nd, 3rd, ... condition so to return the result it will check all condition, but in your case what you want is Ms Excel to count every month and sum it up. So "+" will help you.
    Last edited by jeffreybrown; 03-13-2018 at 09:50 PM. Reason: Removed full quote!

  6. #6
    Registered User
    Join Date
    09-25-2015
    Location
    Phnom Penh, Cambodia
    MS-Off Ver
    2013, 2010
    Posts
    20

    Re: Counting occurences

    RickMcc,

    i have reviewed your attached file and i do have something i don't really understand:
    1-Why you need to have one blank column from day to another day?
    2-You want to have number of consecutive days? which it is normally not run that way.

    however i think you can try this formula:
    =COUNTIFS(C8:BL8,"eS",E8:BN8,"<eS")

    above formula will skip not to count as 2 or 3 or... if eS is coming as consecutive.. please let me know if you still have some error.

    it do took me sometime to come with this solution :-)
    Last edited by jeffreybrown; 03-13-2018 at 09:48 PM. Reason: Removed full quote!

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

    Re: Counting occurences

    Here is a 'low tech' possibility.
    1) Populate the the rows that previously showed only the days of the week with dates using =B7 for the 1st of the month and =C7+1 for the cells to the right (custom format ddd).
    2) Populate column BM using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    3) Populate column BN using: =IF(AND(BM6<>"",BM6<>SUM(BM5,1)),1,0)
    4) Populate cell H56 using: =SUM(BN6:BN371)
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    kroko,

    Thank you very much!
    Last edited by jeffreybrown; 03-13-2018 at 09:51 PM. Reason: Removed full quote!

  9. #9
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    Quote Originally Posted by kroko View Post
    =COUNTIF(C48:BK48,"S*")+COUNTIF(C52:BK52,"S*")+....
    This worked! Thank you
    Last edited by jeffreybrown; 03-13-2018 at 09:47 PM. Reason: Removed full quote!

  10. #10
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    kroko,

    The reason for multiple columns is to allow for multiple types of leaves to be used on the same date. For example if an employee was out sick, but only had 2 hours of sick time available to use. Then one "box" would be for the sick time. The other three boxes would be used to account for the remaining 6 hours (example: vacation for 3 hours & unapproved leave 3 hours). If a box is not used, it grays out.

    I'm trying to make sure consecutive sick days count as 1, not the actual number of days used. Example if employee called in 3 days in a row, it counts as 1 occurrence rather than 3. If the same employee called in sick 1 day, was back at work the next, then out sick the following day, that would be 2 occurrences.

    I really do appreciate your time and effort. Thank you =)
    Last edited by jeffreybrown; 03-13-2018 at 09:47 PM. Reason: Removed full quote!

  11. #11
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Counting occurences

    RickMcc,

    Please don't quote whole posts -- it's just clutter.

    If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.
    HTH
    Regards, Jeff

  12. #12
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    Whoops sorry

  13. #13
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    Thanks everyone for you help

    I'm still having trouble getting this to work they way I need it to. If cells C8, C9, C10 all have a value of "S*", C11 is blank, C12 has a value of "H", and C13 has a value of "S*", how do I get this to equal 2 occurrences of "S*" in Cell E60?

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

    Re: Counting occurences

    Is that the calendar attached to post #1?
    I assume that you are saying three consecutive sick days, a day without notation, a holiday and then another sick day.
    The proposed solution in Post #7 counts that as two occurrences.
    Let us know if you have any questions.

  15. #15
    Registered User
    Join Date
    09-25-2015
    Location
    Phnom Penh, Cambodia
    MS-Off Ver
    2013, 2010
    Posts
    20

    Re: Counting occurences

    Did you try this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It will calculate base on your requirement (for January row) and you just change the row for other months..

  16. #16
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    Kroko,

    =COUNTIFS(C8:BL8,"S*",E8:BN8,"<S*")

    works except it won't recognize "S2" as an occurrence of "S*". The "S2" would indicate the use 2 hours of Sick time. How do I get to recognize "S2"?

    By the way, thank you for your help

  17. #17
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    JeteMC,

    Sorry for delay. Work is getting hectic. Ref solution in #7, when I use it, it calculates the 1st row for the month correctly, but ignores the 2nd row. Also, it appears the formatting for the days of the week is no longer working (if the day cell (Sun, Mon, Tue, etc...) matches either of the DO days, then an "O" should appear, if not then an "R")

  18. #18
    Registered User
    Join Date
    09-25-2015
    Location
    Phnom Penh, Cambodia
    MS-Off Ver
    2013, 2010
    Posts
    20

    Re: Counting occurences

    Hi! great that work!
    but i don't understand your problem that it doesn't recognize "S2" because i test here it do recognize.

    for example if
    1 2 3 4 5 6 7
    SF S2 R SF R R R => then formula will show result as 2
    SF SF R S2 R R R => then result is 2 either
    SF R S2 S2 R R R => then result also 2

    sorry i try to attached file but probably my internet is too slow.
    so it doesn't meet your requirement?
    please let me know

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

    Re: Counting occurences

    Made a few changes:
    1) The formula that populates the cells with either 'R' or 'O' is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    2) Added two cells that display the weekday number in S1:S2 (Monday being the second day of the week and Tuesday the third)
    3) Modified the formula in column BM to read:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    4) Modified the formula in column BN to read:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Notice: the formula for 'R' or 'O' has only been applied to Jan and Feb.
    Notice: The formula in BM now finds S's in either the 1st or 2nd row of each month.
    Notice: The formula in BN assumes the Monday and Tuesday are weekends, and takes sick days that occur on consecutive workdays as being one event. I.E. sick on Sunday and Wednesday.
    Notice: The formula in BN counts sick days on the last workday of one month and the first workday of the next as being one occurrence. I.E. sick on April 29th and May 2nd.
    Let us know if you have any questions.
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    08-30-2016
    Location
    Dallas, Texas
    MS-Off Ver
    excel 2013
    Posts
    71

    Re: Counting occurences

    You Rock! Thank you very much!

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

    Re: Counting occurences

    You're Welcome. Thank You for the feedback (to whomever it is intended) and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Counting no of occurences.
    By trifixion1 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 03-16-2011, 01:53 PM
  2. Counting occurences of a string
    By Garage23 in forum Excel General
    Replies: 6
    Last Post: 07-19-2010, 04:46 PM
  3. Counting Time Occurences
    By GreatLakesJK in forum Excel General
    Replies: 7
    Last Post: 07-08-2010, 02:46 PM
  4. counting occurences
    By joeponcho in forum Excel General
    Replies: 2
    Last Post: 01-16-2008, 09:44 AM
  5. Counting the occurences
    By riomarde in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2006, 04:10 PM
  6. Counting Occurences
    By Tomac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2006, 12:24 AM
  7. Counting Occurences
    By Pete in forum Excel General
    Replies: 7
    Last Post: 05-02-2005, 04:06 PM
  8. [SOLVED] Counting Number of Occurences
    By Darren in forum Excel General
    Replies: 1
    Last Post: 02-23-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