+ Reply to Thread
Results 1 to 8 of 8

countif or sumproduct

  1. #1
    Registered User
    Join Date
    03-19-2007
    Posts
    11

    countif or sumproduct

    i have a column of times (amount of time, not time of day) (M1) and a column of job codes (S=service, R=return call, D=delivery) (L1).
    i would like to calculate how many instances of time (M1) exceed four hours and also have a job code (L1) of "S". can someone help me?

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Try this formula:

    =sumproduct(--(M1:M50>4),--(L1:L50="S"))

  3. #3
    Registered User
    Join Date
    03-19-2007
    Posts
    11

    hmm...

    that didn't work... does it matter that the column (M1) is formatted for time?

  4. #4
    Registered User
    Join Date
    03-19-2007
    Posts
    11

    for reference

    the worksheet i am drawing from is called "march" and the column (M) changed to (N) (sorry for the changes) so my manipulated formula is as follows:

    =SUMPRODUCT(--(March!N:N>4),--(March!L:L="S"))

    it's still not working.
    thanks for any help you can give!

  5. #5
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    It is my understanding that sumproduct cannot refer to an entire column. So, instead of N:N (for example), use N1:N65000.

    Just make sure that all your ranges are equal.

    Let me know if that works.

  6. #6
    Registered User
    Join Date
    03-19-2007
    Posts
    11

    no error this time...

    i changed the formula to this:

    =SUMPRODUCT(--(March!N1:N65000>"4"),--(March!L1:L65000="S"))

    it didn't come back with an error, but it didn't arrive at the correct result either, just a lonely little "0".

  7. #7
    Registered User
    Join Date
    03-19-2007
    Posts
    11

    I figured it out

    the "4" was throwing me off (because it relates to time). i changed the formula to:

    =SUMPRODUCT(--(March!N2:N1000>0.16666),--(March!L2:L1000="S"))

    (0.16666 being the percentage of hours (4) in a day) and it works like a charm. thanks so much for your help!

  8. #8
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Im glad you were able to solve your problem

+ 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