+ Reply to Thread
Results 1 to 9 of 9

Counting amount incorrect within a date range.

  1. #1
    Registered User
    Join Date
    06-08-2009
    Location
    Brighton, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Counting amount incorrect within a date range.

    Hi there

    I would like some help from someone on this subject if possible. I am running a stats report in a workbook where each member of staff have their own running totals of how much work they do and how much of that work is incorrect (per week). I have worked out that if I use the following:-

    =SUMPRODUCT(('Barry Brooks'!$A$1:$A$2000>=$B$95)*('Barry Brooks'!$A$1:$A$2000<=$C$95))

    I get the total amount of work. To explain the above, it returns the amount of times a date appears between two dates i.e B95 is week commencing date and C95 is weekending; therefore giving the total amount of work in that period.

    What I am struggling with is that I need a formula to look at the above date range and then look at another column that has either a ‘Y’ or ‘N’ (for yes or no) and for the formula to count how many N’s there are (thus how many in that given range there were)

    It appears to me quite a small ask for Excel but I can’t seem to get it to work.

    I would really appreciate anyone’s input on this.

    Many thanks in advance.

    Neil Shaw
    Last edited by grungernelly; 06-08-2009 at 10:52 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Counting amount incorrect within a date range.

    =SUMPRODUCT(('Barry Brooks'!$A$1:$A$2000>=$B$95)*('Barry Brooks'!$A$1:$A$2000<=$C$95);--('Barry Brooks'!$C$1:$C$2000="No"))

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Counting amount incorrect within a date range.

    Nothing wrong with zbor's offering but I would say that it makes more sense to use either * or -- ... occasionally useful to mix the two but sometimes more confusing

    =SUMPRODUCT(('Barry Brooks'!$A$1:$A$2000>=$B$95)*('Barry Brooks'!$A$1:$A$2000<=$C$95)*('Barry Brooks'!$C$1:$C$2000="No"))

    or

    =SUMPRODUCT(--('Barry Brooks'!$A$1:$A$2000>=$B$95),--('Barry Brooks'!$A$1:$A$2000<=$C$95),--('Barry Brooks'!$C$1:$C$2000="No"))

    the latter method is regarded as slightly more efficient but does have it's own limitations - for more info on Sumproduct see link to Bob Phillips' white paper on the function in my signature.

  4. #4
    Registered User
    Join Date
    06-08-2009
    Location
    Brighton, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Counting amount incorrect within a date range.

    hi zbor many thanks for your help on this.

    the formula has a semi-colon that Excel sees as an error and when I remove it, the amount of "N's" that it counts is the total for the column (it seems to ignore the date range).

    Any ideas?

    Neil

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Counting amount incorrect within a date range.

    Quote Originally Posted by Stormseed View Post
    Please forgive my ignorance but I would like to know if there is any particular reason for using the double unary negation (--) in your formula ? The asterisk (*) would have coerced the YES & NO to numeric expressions though !
    I don't know.. DonkeyOte once said it's better to use -- than * (I should change first to -- too) and I never questioned that dogma

  6. #6
    Registered User
    Join Date
    06-08-2009
    Location
    Brighton, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Counting amount incorrect within a date range.

    I have used star (*) instead as suggested by donkeyote and have managed to get it to work.

    Many thanks all, very grateful I can stop scratching my head!

    Neil Shaw

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Counting amount incorrect within a date range.

    all 3 works.. they are just 3 combinations out of 8

    please make thread [solved]

    (go to first post -> Edit -> Go advanced -> choose solved from drop down menu

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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