+ Reply to Thread
Results 1 to 10 of 10

COUNT Function Help

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    Calgary Alberta
    MS-Off Ver
    Excel 2010
    Posts
    42

    COUNT Function Help

    I have the following formula to count the number of COMPLETE records that contain dates that fall within a given range..
    =SUMPRODUCT(--($N$2:$N$500<=$Q$1), --($N$2:$N$500>=$P$1), --(COUNTIF($R$1:$S$1, $M$2:$M$500)))
    Where N2:N500 is the date the records were entered
    Where M2:M500 is recorded as either COMPLETE or PENDING
    Where P1 = September 1st, 2012
    Where Q1 = today()
    Where R1 = COMPLETE
    Where S1 = PENDING

    This formula works fine for calculating the number of "COMPLETE" records within the specified dates.
    Now maybe I am overthinking this but I also want to calculate the number of "PENDING" records within the same date range.
    I thought it should have been as easy as flipping the formula around but no.
    I can easily have it calculate the number of BLANK cells within a given range as any cells with "PENDING" in M2:M500 would also contain blank values in N2:N500. The probelm there though is I have to expand the formula as I go in and entered completion dates.

    Long story short I want to be able to calculate the number of either BLANK cells in N2:N500 within a given date range or the number of "PENDING" cells in M2:M500 within a given date range.

    Thanks

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNT Function Help

    Try

    For Complete
    =SUMPRODUCT(--($N$2:$N$500<=$Q$1), --($N$2:$N$500>=$P$1),--($M$2:$M$500=$R$1))

    For Pending
    =SUMPRODUCT(--($N$2:$N$500<=$Q$1), --($N$2:$N$500>=$P$1),--($M$2:$M$500=$S$1))

  3. #3
    Registered User
    Join Date
    05-22-2012
    Location
    Calgary Alberta
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: COUNT Function Help

    I thought that would have worked too but no such luck.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNT Function Help

    In what way did it not work?
    do you get an error? What error?
    Does it give wrong result? What result DID it give? What result did you expect, and why?

    Can you post a sample book?

  5. #5
    Registered User
    Join Date
    05-22-2012
    Location
    Calgary Alberta
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: COUNT Function Help

    It is still giving me a zero value when it should be reporting 12.
    Sample book attached.
    Thanks in advance for your help.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-22-2012
    Location
    Calgary Alberta
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: COUNT Function Help

    I have highlighted J2 as the cell where the formula is located.
    As you can see records 1 to 16 all have target dates scheduled before today but only records 3, 7, 11 and 16 have been completed as indicated in cell I2 therefore J2 should be reporting 12.

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNT Function Help

    0 is the correct answer because there are 0 DATES in Column E that are Between G1 and H1 with the word PENDING in column D.

    Blanks do not count as dates.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNT Function Help

    OK, I see it now.

    for PENDING, you need to check for dates in column C not E..
    Although there are actually 11 not 12. Record 1 is in the year 2008, definately not between 2012-2013

    So for Complete
    =SUMPRODUCT(--($E$2:$E$300<=$H$1), --($E$2:$E$300>=$G$1), --($D$2:$D$300=$I$1))

    And for pending
    =SUMPRODUCT(--($C$2:$C$500<=$H$1), --($C$2:$C$500>=$G$1),--($D$2:$D$500=$J$1))
    Last edited by Jonmo1; 04-23-2013 at 09:24 AM.

  9. #9
    Registered User
    Join Date
    05-22-2012
    Location
    Calgary Alberta
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: COUNT Function Help

    Is there an emoticon for epic face palm? I need one. lol
    Thanks for your help

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNT Function Help

    Great, glad it's worked out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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