+ Reply to Thread
Results 1 to 10 of 10

Summing row ranges based on non-sequential column criteria

  1. #1
    Registered User
    Join Date
    06-19-2014
    Location
    Midlands, UK
    MS-Off Ver
    2010
    Posts
    58

    Summing row ranges based on non-sequential column criteria

    Hi All, newbie forum member here but long term "jack of all" and hope I can answer as many questions as I ask :-)

    I have a question regarding a spreadsheet task I am working on. (Mention now that Pivot tables are a little mystery to me and I have a feeling people are going to point me in this direction so please go slow).

    I am trying to sum a number of non-sequential columns based on criteria from another column. I have managed to make it work on one row only, but when I try and expand this out to multiple rows (>800), I can't make it work. The formula I have that works on 1 row is below, and hope this explains in more detail.

    =IF('Resource Projection'!D40='Plan V Actual'!J6,SUM('Resource Projection'!Q40,'Resource Projection'!S40,'Resource Projection'!U40,'Resource Projection'!W40,'Resource Projection'!Y40,'Resource Projection'!AA40,'Resource Projection'!AC40),0)

    Cell J6 is the resource name reference. The above works fine for only one row, but I want to expand the range out to all 800 rows but conditionally sum only based on resource name.

    Thanks in advance all for any help you can offer.

    Paul

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: Summing row ranges based on non-sequential column criteria

    I'm guessing J6 should be J$6.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    06-19-2014
    Location
    Midlands, UK
    MS-Off Ver
    2010
    Posts
    58

    Re: Summing row ranges based on non-sequential column criteria

    Thanks for the quick reply Jacc. I think I over explained myself. Rather than go into different sheets, I have used the following of an example of what I want to do. I know this does not work, but if you can follow the syntax of where I am trying to go.....

    =sumif(D40:D48,"R5",Q40:Q48,S40:S48)

    Whereas the one below does work but only for a single sum range. Once I try to add more than one sum range, this falls over and thats what I need to do.

    Thanks

    =sumif(D40:D48,"R5",Q40:Q48)

  4. #4
    Registered User
    Join Date
    06-19-2014
    Location
    Midlands, UK
    MS-Off Ver
    2010
    Posts
    58

    Re: Summing row ranges based on non-sequential column criteria

    Hi all again, I have managed to make the above scenario work as to how I want it now. However, the way I have done it is not pretty. So you guessed it, my next question is this, is there anyway I can make the following statement a little more manageable and usable? Thanks in advance again.

    =SUMIF(D40:D48,"R5",Q40:Q48)+SUMIF(D40:D48,"R5",S40:S48)+SUMIF(D40:D48,"R5",U40:U48)+SUMIF(D40:D48,"R5",W40:W48)+SUMIF(D40:D48,"R5",Y40:Y48)+SUMIF(D40:D48,"R5",AA40:AA48)+SUMIF(D40:D48,"R5",AC40:AC48)

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Summing row ranges based on non-sequential column criteria

    Quote Originally Posted by TexasKersh View Post

    =SUMIF(D40:D48,"R5",Q40:Q48)+SUMIF(D40:D48,"R5",S40:S48)+SUMIF(D40:D48,"R5",U40:U48)+SUMIF(D40:D48,"R5",W40:W48)+SUMIF(D40:D48,"R5",Y40:Y48)+SUMIF(D40:D48,"R5",AA40:AA48)+SUMIF(D40:D48,"R5",AC40:AC48)
    What's in the columns between the sum ranges? If they're empty as demonstrated below then we can find a solution.

    Data Range
    Q
    R
    S
    T
    U
    V
    W
    X
    Y
    Z
    AA
    AB
    AC
    40
    17
    38
    39
    42
    6
    81
    62
    41
    8
    99
    9
    98
    5
    79
    54
    42
    58
    60
    94
    95
    97
    46
    87
    43
    85
    10
    42
    77
    50
    89
    15
    44
    55
    55
    38
    42
    56
    22
    15
    45
    19
    37
    86
    46
    12
    40
    48
    46
    43
    4
    39
    81
    54
    69
    40
    47
    86
    46
    3
    57
    87
    49
    89
    48
    93
    27
    30
    36
    89
    22
    48
    49
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Summing row ranges based on non-sequential column criteria

    Try this:

    =SUM(IF(D40:D48="R5",IF(ISNUMBER(Q40:AC48),IF(MOD(COLUMN(Q40:AC48),2)=1,Q40:AC48))))

    Press Ctrl+Shift+Enter, not just Enter

  7. #7
    Registered User
    Join Date
    06-19-2014
    Location
    Midlands, UK
    MS-Off Ver
    2010
    Posts
    58

    Re: Summing row ranges based on non-sequential column criteria

    Hi Teethless, Tony

    Thanks for the reply.

    The reason for the additional column is for data entry to calculate the fields I am reporting on. Not how I would have done it, but as mentioned, I have inherited this from a previous guy. Legacy data and all that :-)

    Given the above, would it still be worth trying your formula Teethless as the column Tony refers to here would have number values rather than text or the like.

    Thanks guys

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Summing row ranges based on non-sequential column criteria

    You can use the suggested formula but I would tweak it to be more robust.

    Array entered**:

    =SUM(IF(D40:D48="R5",IF(ISNUMBER(Q40:AC48),IF(MOD(COLUMN(Q40:AC48)-COLUMN(Q40),2)=0,Q40:AC48))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  9. #9
    Registered User
    Join Date
    06-19-2014
    Location
    Midlands, UK
    MS-Off Ver
    2010
    Posts
    58

    Re: Summing row ranges based on non-sequential column criteria

    Thanks for the above guys. I have just tried this and seems to work well.

    :-) Happy newbie and have some rep. Top job.

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Summing row ranges based on non-sequential column criteria

    You're welcome. We appreciate the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Summing multiple ranges based on criteria....
    By Barking_Mad in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-26-2014, 06:42 AM
  2. [SOLVED] Summing Range based on Criteria of Two Other Ranges
    By kidsick in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-14-2013, 10:35 PM
  3. Replies: 13
    Last Post: 07-08-2009, 04:27 PM
  4. Summing rows based on criteria in another column
    By reybie in forum Excel General
    Replies: 2
    Last Post: 07-11-2006, 02:15 PM
  5. [SOLVED] Counting & Summing based on criteria on another column
    By Chicago D in forum Excel General
    Replies: 2
    Last Post: 08-25-2005, 02:05 PM

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