+ Reply to Thread
Results 1 to 5 of 5

Need a formula that adds a set of values that are associated with a unique set of values

  1. #1
    Registered User
    Join Date
    02-16-2013
    Location
    Guelph, CANADA
    MS-Off Ver
    Excel 2011 MAC
    Posts
    2

    Need a formula that adds a set of values that are associated with a unique set of values

    Hello all,

    I'm trying to create a formula that will add all the values from a range of cells in one column (Column B) that are associated with a set of cells in another column (Column A), and in this other column there are many unique sets of similar values.

    For example Column A (lake name) looks like this:

    A1 = Red Lake
    A2 = Red Lake
    A3 = Blue Lake
    A4 = Blue Lake
    A5 = Blue Lake
    A6 = Green Lake
    A7 = Green Lake
    A8 = Green Lake
    A9 = Green Lake
    ...
    A451 = Turquoise Lake
    A452 =Turquoise Lake

    Column B (lake chlorine concentration) looks like this:

    B1 = 5
    B2 = 7
    B3 = 1
    B4 = 2
    B5 = 3.5
    B6 = 4
    B7 = 3
    B8 = 1
    B9 = 2.25
    ...
    B451 = 4
    B452 = 3

    In column C, I'd like to enter a formula that will yield the sum of the values from each range of cells in Column B that are associated with each unique set of similar values from Column A. So, the results in Column C would look like this:

    C1 = 12 (sum of B1+B2, which are collectively associated with the UNIQUE SET of values in Column A, namely "Red Lake")
    C2 = 12 (dito)
    C3 = 6.5 (sum of B3+B4+B5, which are collectively associated with the UNIQUE SET of values in Column A, namely "Blue Lake")
    C4 = 6.5 (dito)
    C5 = 6.5 (dito)
    C6 = 10.25 (etc....)
    C7 = 10.25
    C8 = 10.25
    C9 = 10.25
    ...
    C451 = 7
    C452 = 7

    Since there are about 200 lakes, I'm trying to avoid entering 200 different SUM formulas. I am an Excel novice, but I presume this would require an array formula, if even possible with a formula.

    Thanks for any help offered!

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Need a formula that adds a set of values that are associated with a unique set of valu

    wont just =sumif($a$1:$a$500,a2,$b$2:$b$500) work?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Need a formula that adds a set of values that are associated with a unique set of valu

    Hello and welcome to the forum.

    Would it be possible for you to upload a sample workbook ? thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Registered User
    Join Date
    02-16-2013
    Location
    Guelph, CANADA
    MS-Off Ver
    Excel 2011 MAC
    Posts
    2

    Re: Need a formula that adds a set of values that are associated with a unique set of valu

    Thank you martindwilson, your suggested formula worked! Thank you to both for your help and welcoming.

    -Trevor

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Need a formula that adds a set of values that are associated with a unique set of valu

    Great..!!
    Thanks to Martin.

    Trevor, please mark this thread as [SOLVED]....



    Regards,
    DILIPandey
    <click on below * if this helps>

+ 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