+ Reply to Thread
Results 1 to 10 of 10

Sum certain jobs

  1. #1
    Registered User
    Join Date
    11-11-2009
    Location
    SC
    MS-Off Ver
    Excel 2003
    Posts
    22

    Sum certain jobs

    Now that I have the jobs (and corresponding information) assigned to their respective regions, things get a little more complicated as I need to do 3 more things. Here is the first one ...

    1) I need to sum the number of jobs for each region. The catch is that I need to exclude the Wal Mart jobs. This would mean that I need to look in Column H and total all of the jobs that are NOT "WAL-MART STORES, INC". I would also need to look in COLUMN T and sort them by Region.

    For the South East Region, I am entering this sum in B25. I'll then do the same thing for the other 4 regions.

    How do I do that?
    Last edited by ryan@csi; 11-12-2009 at 05:40 PM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Need to sum jobs but exclude certain ones ...

    Hi,

    does your data include all regions? What is the column where the region is stored? T? What is the column where the values are stored?

    I don't know your data layout, so please post a small data sample, or have a play with

    =SUMPRODUCT(--(T2:T100="West"),--(H2:H100<>"WAL-MART STORES, INC"),(R1:R100))

    where column R holds the values to sum. Adjust ranges to suit.

    Overall it sounds as if you might be better off with a pivot table. That's exactly what they do.

  3. #3
    Registered User
    Join Date
    11-11-2009
    Location
    SC
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Need to sum jobs but exclude certain ones ...

    Quote Originally Posted by teylyn View Post
    Hi,

    does your data include all regions? What is the column where the region is stored? T? What is the column where the values are stored?
    Yes, the data includes all regions. The regions are identified in Column T.

    To give you an idea of where the values are stored, I have attached a "sample" of the spreadsheet. For the purposes of this question, the critical values are in columns H (Customer Name) and T (Region). As I mentioned in the original post, I need to sum the number of jobs for each region but I need to exclude the jobs entitled "WAL-MART STORES, INC".

    The sums for the regions will go in the following cells:
    SOUTH ATLANTIC --> B25
    NORTH ATLANTIC --> B30
    SOUTH CENTRAL --> B35
    NORTH CENTRAL --> B40
    WEST --> B45
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-11-2009
    Location
    SC
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Sum certain jobs

    Thank you ... I tweaked that formula a little bit and it worked. Now I need to add one more "filter" to it. I need to be doing the same thing as this formula:

    =SUMPRODUCT(--(T2:T1079="SOUTH ATLANTIC"),--(H2:H1079<>"WAL-MART STORES, INC"),(J2:J1079))

    In addition to excluding "WAL-MART STORES, INC" in Column H, what I need to do this time is only sum the values in Column N that have "SPC".

    What do I do?

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Sum certain jobs

    Well, with the SUMPRODUCT syntax being

    =SUMPRODUCT(--(condition1),--(condition2),....--(conditionx),(sum array))

    you just need to add another condition array in the formula


    =SUMPRODUCT(--(T2:T1079="SOUTH ATLANTIC"),--(H2:H1079<>"WAL-MART STORES, INC"),--(N2:N1079<>"SPC"),(J2:J1079))

  6. #6
    Registered User
    Join Date
    11-11-2009
    Location
    SC
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Sum certain jobs

    Quote Originally Posted by teylyn View Post
    Well, with the SUMPRODUCT syntax being

    =SUMPRODUCT(--(condition1),--(condition2),....--(conditionx),(sum array))

    you just need to add another condition array in the formula


    =SUMPRODUCT(--(T2:T1079="SOUTH ATLANTIC"),--(H2:H1079<>"WAL-MART STORES, INC"),--(N2:N1079<>"SPC"),(J2:J1079))
    OK, I did that but I don't think it's working. Can you explain the formula for me? For instance, is it saying to sum the total of column J for those that don't meet the conditions that are listed? Or is it saying to sum the total of column J for the do meet the listed conditions?

    Does that make sense?

  7. #7
    Registered User
    Join Date
    11-11-2009
    Location
    SC
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Sum certain jobs

    I'm not familiar with this function and what is going on - what does "--" mean?

  8. #8
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Sum certain jobs

    The -- is called the double unary. A statement like

    T2:T1079="SOUTH ATLANTIC"

    will produce an array of TRUE and FALSE values. With the double unary, these will be coerced (read: translated) into 1 and 0 respectively and can then be used in mathematical calculations.

    hth

  9. #9
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Sum certain jobs

    OK, I did that but I don't think it's working. Can you explain the formula for me? For instance, is it saying to sum the total of column J for those that don't meet the conditions that are listed? Or is it saying to sum the total of column J for the do meet the listed conditions?
    Oops, sorry, I put in a "does not equal SPC" instead of "is equal to SPC".

    correct formula should be

    =SUMPRODUCT(--(T2:T1079="SOUTH ATLANTIC"),--(H2:H1079<>"WAL-MART STORES, INC"),--(N2:N1079="SPC"),(J2:J1079))

  10. #10
    Registered User
    Join Date
    11-11-2009
    Location
    SC
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Sum certain jobs

    It worked - thanks!!

+ 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