+ Reply to Thread
Results 1 to 8 of 8

Specify multiple rows for SUMIF range?

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    London
    MS-Off Ver
    365
    Posts
    71

    Specify multiple rows for SUMIF range?

    Hi there, I have been trying to get excel to lookup two rows in the formula range, but when I do this the formula stops working altogether. Please see attached example of what I mean.

    Be grateful for any help on this one as it's got me scratching my head.

    Thanks very much.

    Kate :-)
    Attached Files Attached Files
    Last edited by necht_angel; 11-17-2011 at 04:16 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Specify multiple rows for SUMIF range?

    Your first range was different in that I14 cell.

    Try in G8:

    =SUMIF($A$2:$F$2,G$2,$A8:$F9)

    then just copy down and across the matrix

    i don't understand the data validation question in your worksheet comment.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    09-21-2011
    Location
    London
    MS-Off Ver
    365
    Posts
    71

    Re: Specify multiple rows for SUMIF range?

    Hi, thanks. What I want is the formula in cell I14 to work, and to apply it to all the other cells. I want to incorporate both rows in the lookup range, but that doesn't seem to work, and I can't figure out why the formula in cell I14 won't work. Can I not lookup more than one row?

    Thanks NBVC

    Kate

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Specify multiple rows for SUMIF range?

    SUMIF makes the sum range the same size as the criteria range (implicitly - even if you don't specify it that way explicitly).

    I think that you may want to specify 1st in G2 and still pick up the value from A8? Try SUMPRODUCT, i.e. this formula in G8

    =SUMPRODUCT(($A$1:$F$2=G$2)*$A8:$F8)

    copied across and down
    Audere est facere

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Specify multiple rows for SUMIF range?

    The SUMIF formula provides the same results....

    Enter either formula in G8, then copy down and across... I14 will then have a value....

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Specify multiple rows for SUMIF range?

    Quote Originally Posted by NBVC View Post
    The SUMIF formula provides the same
    .....not if you select "1st" from the dropdown in G2.....

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Specify multiple rows for SUMIF range?

    Ah yes, thanks... I guess I misinterpreted...

  8. #8
    Registered User
    Join Date
    09-21-2011
    Location
    London
    MS-Off Ver
    365
    Posts
    71

    Re: Specify multiple rows for SUMIF range?

    Quote Originally Posted by daddylonglegs View Post
    SUMIF makes the sum range the same size as the criteria range (implicitly - even if you don't specify it that way explicitly).

    I think that you may want to specify 1st in G2 and still pick up the value from A8? Try SUMPRODUCT, i.e. this formula in G8

    =SUMPRODUCT(($A$1:$F$2=G$2)*$A8:$F8)

    copied across and down
    That works brilliantly, thanks so much, perfect.

    Kate :-)

+ 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