+ Reply to Thread
Results 1 to 2 of 2

Sum multiple rows based on criteria spread across multiple rows and columns

  1. #1
    Registered User
    Join Date
    05-18-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    Sum multiple rows based on criteria spread across multiple rows and columns

    Hi Guys,

    After having found more than I ever wanted to know about excel from this site over the past few years, I now find myself with a challenge I can't quite solve from previous posts. I've searched here -> http://www.excelforum.com/search.php?searchid=1529120 and not found my answer unfortunately so I hope some one has the time to help me.

    I do hope that the title is clear enough.

    Please see the attachmet for my sample data.

    I need to populate the "New customer value" cell with a sum of all the values in colF where the customer is a new customer. New customer is defined as a customer who had no revenue, of any "type" for the previous month.

    This array formula, derived from the help files example for counting unique values, gives me a count of the new OAC:
    {=SUM(IF(FREQUENCY(IF(E2:E18=0,IF(F2:F18<>0,MATCH($B2:$B18,$B3:$B18,0),""),""), IF(E2:E18<0,IF(F2:F18<>0,MATCH($B2:$B18,$B2:$B18,0),""),""))>0,1))}
    this is working correctly.

    I have tried many variations on the following to attempt to sum the values, but it is incorrect:
    {=SUM(IF(FREQUENCY(IF(E2:E18=0,IF(F2:F18<>0,MATCH($B2:$B18,$B2:$B18,0),""),""), IF(E2:E18<0,IF(F2:F18<>0,MATCH($B2:$B18,$B2:$B18,0),""),""))>0, INDEX(F2:F18,ROW(B2:B18))))}
    I am struggling with referring to the current position within the array to determine which figure to add in the last section of the forumla.

    I can manually achieve what I need for a given worksheet and month but I have 16 sheets spanning hundreds of rows across an 18 month period so automating will be the only way to get this done in a reasonable time frame.

    I would be very grateful of any help you can give at all.

    Many thanks in advance


    FYI: I have also posted this question on ozgrid.com here http://www.ozgrid.com/forum/showthread.php?t=136960 but have not recieved a response as yet.
    Attached Files Attached Files

  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: Sum multiple rows based on criteria spread across multiple rows and columns

    Quote Originally Posted by CIsor View Post
    I need to populate the "New customer value" cell with a sum of all the values in colF where the customer is a new customer. New customer is defined as a customer who had no revenue, of any "type" for the previous month.
    Like this then:
    =SUMPRODUCT(--(E2:E18=0),F2:F18)


    or this:
    =SUMIF(E2:E18,"",F2:F18)
    For this function, you are looking for a total value, so you don't really need to evaluate the customers themselves, right? It's a total.
    Last edited by JBeaucaire; 05-18-2009 at 11:23 AM.
    _________________
    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!)

+ 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