+ Reply to Thread
Results 1 to 11 of 11

Countif problem

Hybrid View

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Countif problem

    I have a table let say column F has dates in it and column B has employee names in it. How would I count the number of times this employee is in the column B between the two dates.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Countif problem

    You would use COUNTIFS function if your Excel version is 2007 or later. I see from your profile, however, that you are using XL2003, and COUNTIFS isn't available in that version - if you have updated the version and not changed your profile, please do so.

    You could use a SUMPRODUCT formula instead.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Countif problem

    If you're truly using Excel 2003 or saving as "xls", you cannot use COUNTIFS (with an "S"). So use SUMPRODUCT, to wit:

    =SUMPRODUCT((B2:B1000=E2)*(F2:F1000>=D1)*(F2:F1000<=D2))

    where E2 contains the employee name, D1 contains the earlier date, and D2 contains the later date.

    You might want to use some form of absolute references, if you intend to copy the formula.

    OTOH, if you are not actually using Excel 2003 and you do not save as "xls", you can use COUNTIFS, to wit:

    =COUNTIFS(B2:B1000,E2,F2:F1000,">="&D1,F2:F1000,"<="&D2)

  4. #4
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Countif problem

    Sorry I do use Excel 2010. Here is what I have and it won't work.

    =COUNTIFS('Working Apps. in the Funnel'!F2:F227,"AL",'Working Apps. in the Funnel'!J2:J227,">="&H37,'Working Apps. in the Funnel'!F2:F200,"<="&I37)

    The data is in one book and the dates are entered two different cells (a start date and end date) in another book where the result show up.

  5. #5
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Countif problem

    Sorry I do use Excel 2010. Here is what I have and it won't work.

    =COUNTIFS('Working Apps. in the Funnel'!F2:F227,"AL",'Working Apps. in the Funnel'!J2:J227,">="&H37,'Working Apps. in the Funnel'!F2:F200,"<="&I37)

    The data is in one book and the dates are entered two different cells (a start date and end date) in another book where the result show up.

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,227

    Re: Countif problem

    It looks like you need to change the end of your formula to J2:J200 instead of F2:F200. (I'm assuming your dates are in Column J)
    Last edited by Gregb11; 09-04-2019 at 10:11 PM. Reason: Additional clarification

  7. #7
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Countif problem

    Quote Originally Posted by Gregb11 View Post
    It looks like you need to change the end of your formula to J2:J200 instead of F2:F200. (I'm assuming your dates are in Column J)
    Actually, J2:J227, just like the previous terms. I assume that H37 is the start date and I37 is the end date.

  8. #8
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Countif problem

    The formula still returns a #VALUE!

  9. #9
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Countif problem

    Quote Originally Posted by JimLau View Post
    The formula still returns a #VALUE!
    With Gregb's suggestion (J2:J200), yes. But with my suggestion (J2:J227), it eliminates the #VALUE error (for me). Namely:

    =COUNTIFS('Working Apps. in the Funnel'!F2:F227,"AL",'Working Apps. in the Funnel'!J2:J227,">="&H37,'Working Apps. in the Funnel'!J2:J227,"<="&I37)

    Of course, I cannot say whether or not COUNTIFS returns the expected value. That would depend on the values in H37, I37, F2:F227 and J2:J227, which you have not provided.

    If you still have a problem using J2:J227 consistently, I suggest that you attach an Excel file that demonstrates the problem. In this forum's UI, click Go Advanced, Manage Attachments, Browse, then Upload.
    Last edited by joeu2004; 09-05-2019 at 03:00 AM.

  10. #10
    Registered User
    Join Date
    09-26-2012
    Location
    socal
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Countif problem

    Thank you it worked. I didn't think the range would make a difference but it did. Will leave a Rep.

+ 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 problem
    By Phlegon_of_Tralles in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-02-2017, 02:46 PM
  2. [SOLVED] COUNTIF Problem
    By redimp in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-28-2014, 04:13 AM
  3. Countif problem
    By buffalobill in forum Excel General
    Replies: 2
    Last Post: 05-27-2010, 08:46 AM
  4. COUNTIF Problem
    By Dan Mackman in forum Excel General
    Replies: 2
    Last Post: 11-12-2008, 10:33 AM
  5. Countif Value problem
    By James580 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-09-2008, 03:47 PM
  6. Countif Problem
    By Mark W in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-21-2006, 03:40 PM
  7. Countif Problem
    By Obespalov in forum Excel General
    Replies: 0
    Last Post: 02-10-2005, 05:23 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