+ Reply to Thread
Results 1 to 4 of 4

sum values of adjecent cells in a row if cells in a seperate column contain a value

Hybrid View

  1. #1
    Registered User
    Join Date
    02-07-2012
    Location
    austin
    MS-Off Ver
    Excel 2010
    Posts
    2

    sum values of adjecent cells in a row if cells in a seperate column contain a value

    Greetings,

    First time here. I have a fairly good feel for excel but haven't been able to put this together, let's see if I can explain.

    I have in column A and B, dollar amounts for specific purchases. In column C there are numbers representing vendors. What i would like to do is set up a formula to look at column C and find all cells containing, for example, 5 (code for vendor). Then look to the adjacent cells in column A and B for the dollar amounts purchased from vendor 5 and sum a total dollars spent. So just to explain from a slightly different angle; there could be 10 or 15 logged purchases from vendor 5 in column C in no particular pattern or order. I want it to find all the rows in column c with a value equal to 5 then look left into the A and B column and give a combined total of all the dollar amounts.

    Any guidance is greatly appreciated.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: sum values of adjecent cells in a row if cells in a seperate column contain a val

    Try

    =SUMPRODUCT((C:C=5)*(A:B))

  3. #3
    Registered User
    Join Date
    02-07-2012
    Location
    austin
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: sum values of adjecent cells in a row if cells in a seperate column contain a val

    thank you!

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

    Re: sum values of adjecent cells in a row if cells in a seperate column contain a val

    Try:

    =SUMIF(C:C,5,A:A)+SUMIF(C:C,5,B:B)

    you can replace the 5's with a cell reference if you are copying formula down for other Vendor codes.
    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.

+ 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