+ Reply to Thread
Results 1 to 6 of 6

Alternative to summing nested If's

  1. #1
    Registered User
    Join Date
    06-18-2007
    MS-Off Ver
    2007
    Posts
    77

    Alternative to summing nested If's

    I have a table of approx 20k customers (column A) and their $ sales (column B)for a time period. I need to sum the sales of approx 50 customers. I have the names of the 50 customers to be summed in one column so i can reference them and easily change out a customer if need be. Can anyone suggest an alternative to creating a nested sum that repeats 50 times? I can not change the source data at all, so I have to pull the data into anther area. Thanks.
    Last edited by mashley; 10-09-2009 at 09:39 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Alternative to summing nested If's

    You want a SUMIF() formula.

    Ref Names - column A
    Ref Values - column B

    Names to Sum - column C
    Formulas - Column D

    If the first name is in C2, put this in D2 and copy down:

    =SUMIF(A:A, C2, B:B)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-18-2007
    MS-Off Ver
    2007
    Posts
    77

    Re: Alternative to summing nested If's

    Thanks for the quick response.
    My fault for not specifying...I would like the summed result of all 50 customers in one cell, preferably without the intermediate step of sumif next to each customer.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Alternative to summing nested If's

    How about this:

    =SUM(SUMIF(A:A, C1:C50, B:B))

    ...or even:
    =SUM(SUMIF(A:A, C:C, B:B))

    I wouldn't use a LOT of those in your sheet.

  5. #5
    Registered User
    Join Date
    06-18-2007
    MS-Off Ver
    2007
    Posts
    77

    Re: Alternative to summing nested If's

    thanks for the help.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Alternative to summing nested If's

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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