+ Reply to Thread
Results 1 to 8 of 8

sum index match returning first value not adding

  1. #1
    Registered User
    Join Date
    10-26-2006
    Posts
    18

    sum index match returning first value not adding

    I am tyring unsucessfully to add up some values in an array - the formula below is simply returning the first value. Can anyone see where I have gone wrong please.

    =SUM(INDEX('nominal apportionments'!B96:J432,MATCH(B95:C95,'nominal apportionments'!B96:B432),9))

    What I want to do is add all the values in column 9 (J) where the values in column B equal the values in the range b95 to c95 on the current sheet.

    Thanks

    E

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sum index match returning first value not adding

    Couple of options spring to mind immediately:

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: sum index match returning first value not adding

    DonkeyOte,

    Why not

    =SUMPRODUCT(('nominal apportionments'!$B$96:$B$432=$C95:$D95)*('nominalapportionments'!$J$96:$J$432))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sum index match returning first value not adding

    That too if you can be sure the latter range will always contain numerics.

  5. #5
    Registered User
    Join Date
    10-26-2006
    Posts
    18

    Re: sum index match returning first value not adding

    thanks for your help - however both the sumproduct formulas only return the second value, they do not add up the two values.

    Donkey - your first formula does work but in reality my range for input criteria b96 to c 96 could be much longer and varialble number of cells - so something that can deal with this would be better.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: sum index match returning first value not adding

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    There's no reason why the SUMPRODUCT would fail to return the correct result as I see it...

  7. #7
    Registered User
    Join Date
    10-26-2006
    Posts
    18

    Re: sum index match returning first value not adding

    My mistake - copied forumla into wrong columns. Both sumproducts do work.

    Can anyone advise why my sum index match formula did not work?

    thanks

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

    Re: sum index match returning first value not adding

    Quote Originally Posted by each View Post
    Can anyone advise why my sum index match formula did not work?
    MATCH returns an array but, except in some convoluted circumstances, INDEX does not so you can't use that form to do what you require......

+ 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