+ Reply to Thread
Results 1 to 9 of 9

Adding values from adjacent cells

  1. #1
    Registered User
    Join Date
    08-23-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Unhappy Adding values from adjacent cells

    Hi,

    New user here....wonder if anyone can help me!

    I have created a spreadsheet to help calculate some results of a sports match then tabulate the players performances. Below is an example of the data:

    "Player 1" 4 "Player 2" 1
    "Player 2" 3 "Player 1" 2
    "Player 3" 1 "Player 4" 4
    "Player 4" 3 "Player 1" 2

    I have used the SUMIF function to calculate the "for" figure for each player but am struggling with calcluating the "against" figure. How do I get it to add together the values of the other players?

    So, if I highlight the whole range and sumif "Player 1" it totals the number of games won by each player. But how do I get it to add up the values against Player 1?

    Any help appreciated!!
    Last edited by buzzin77; 08-23-2010 at 01:06 PM.

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

    Re: Adding values from adjacent cells

    Assuming you have your data in A1:D4, then try:

    =SUMPRODUCT((A1:A4="player 1")*(D1:D4))+SUMPRODUCT((C1:C4="Player 1")*(B1:B4))

    adjust as necessary.
    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
    08-23-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding values from adjacent cells

    Thanks for the response!

    However, I think that would do the same thing as SUMIF and highlighting the whole data range. As it is not the value next to the Player 1 I want to total, but the score of his opponent. Does that make sense?

    Thanks!

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

    Re: Adding values from adjacent cells

    The formula above would yield 7 with your sample.. Is that correct?

    What it is doing is looking in the first column and finding Player 1, then adding what is in the opposing teams column (column D) and then it is looking for Player 1 in column C and again summing the opposing team's scores... then adding both results together.

  5. #5
    Registered User
    Join Date
    08-23-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding values from adjacent cells

    Apologies! You are absolutely right.

    That's great - Thank you!!

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

    Re: Adding values from adjacent cells

    Great!

    Please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  7. #7
    Registered User
    Join Date
    08-23-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding values from adjacent cells

    Excuse my incompetence......how?

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

    Re: Adding values from adjacent cells

    I outlined the steps in my last post.

  9. #9
    Registered User
    Join Date
    08-23-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Adding values from adjacent cells

    Sorry....saw that and have done so. What a numpty I am! It's been a long day

+ 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