+ Reply to Thread
Results 1 to 11 of 11

Countif between 2 dates with multiple criteria

  1. #1
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Countif between 2 dates with multiple criteria

    I am trying to count how many 'active' employees I have week to week, with 2 other criteria.

    sheet1 has the data and over time 4 employees have been 'term' (terminated).

    sheet2 is where I need the formula. So, essentially I need a running total of active employees for the week end for rep/Lead/Sup (criteria 1) and ORG (criteria 2) in columns B,c, and d

    You can ignore columns F:I, I'll just copy/paste the formula and adjust as necessary. Thanks for the help.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countif between 2 dates with multiple criteria

    Might be nicer as a SUMPRODUCT but try this

    In B3 copied across and down

    =COUNTIFS(Sheet1!$C$2:$C$12, Sheet2!B$2, Sheet1!$D$2:$D$12, $C$1,Sheet1!$F$2:$F$12, ">"&Sheet2!$A3)+COUNTIFS(Sheet1!$C$2:$C$12, Sheet2!B$2, Sheet1!$D$2:$D$12, $C$1,Sheet1!$F$2:$F$12, "")

    In G3 copied across and down

    =COUNTIFS(Sheet1!$C$2:$C$12, Sheet2!G$2, Sheet1!$D$2:$D$12, $H$1,Sheet1!$F$2:$F$12, ">"&Sheet2!$F3)+COUNTIFS(Sheet1!$C$2:$C$12, Sheet2!G$2, Sheet1!$D$2:$D$12, $H$1,Sheet1!$F$2:$F$12, "")
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Countif between 2 dates with multiple criteria

    Thanks for the response. This is close, but doesn't work entirely.

    I should have been more clear. This will be an ongoing count, so when I term or active additional employees, the previous weeks counts change but I need the counts to remain as they were.

    For example, if I add a active/rep/org for week end 12/20, the previous weeks count will go up by 1 too. Can we somehow adjust the formula so instead of doing a > on the term week end date, we use count of active or term as the criteria instead?

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countif between 2 dates with multiple criteria

    If you add more people, you will need to add a new column for start date won't you? If you do that, then that can go into the criteria. Otherwise, I don't see how Excel would know who was here when.

  5. #5
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Countif between 2 dates with multiple criteria

    correct. I added 2 columns and reattached.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countif between 2 dates with multiple criteria

    Added appropriate terms. Se attachment
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Countif between 2 dates with multiple criteria

    when I add a new entry all the previous weeks still + 1

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countif between 2 dates with multiple criteria

    Did you modify the ranges in the formulas? I.e. Sheet1!$C2:$C$100 instead of C2:C12? Pick a number greater than your expected entries and modify all accordingly (Note: you only have to modify B2 and G3, and copy and paste them accordingly.)

  9. #9
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Countif between 2 dates with multiple criteria

    What's happening is the following:

    I did adjust the formulas to include a longer range. When I add a date in the week end column, it works good (column H). The issue is when I add a new entry with a later date. For example, I entered a new employee with a hire date of 1-3-2016. The previous week end counts all go up by 1, and I only want the week end count of the appropriate weekend to go up. All the previous week ends should stay the same.

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Countif between 2 dates with multiple criteria

    Can you upload an example, highlight the incorrect value(s)?

  11. #11
    Forum Contributor
    Join Date
    08-29-2014
    Location
    Chicago, IL
    MS-Off Ver
    2014
    Posts
    164

    Re: Countif between 2 dates with multiple criteria

    please see attached. thanks for the help
    Attached Files Attached Files

+ 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 (or maybe it's Sumproduct?) meets two criteria and between two dates
    By JasonNeedsHelp in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-14-2014, 12:50 PM
  2. Return dates that match a single criteria (a countif criteria)
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2014, 12:43 PM
  3. [SOLVED] trying to do a "countif" with multiple ranges and multiple criteria. Countif, Sumproduct?
    By completelyhis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2013, 06:12 PM
  4. Multi-criteria countif functions for dates...possible?
    By Rekli in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-11-2006, 05:51 PM
  5. Use multiple criteria with COUNTIF: between dates and not blank
    By l.shields in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-13-2006, 02:25 PM
  6. [SOLVED] COUNTIF, dates and blank cell criteria
    By luvthavodka in forum Excel General
    Replies: 6
    Last Post: 06-01-2006, 04:55 PM
  7. [SOLVED] Countif w/ Multiple Criteria-How do I use countif
    By Patrick_KC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-09-2005, 05:05 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