Sum non adjacent cells with criteria

sooshil

Board Regular
Joined
Feb 21, 2013
Messages
104
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hello

I have data to analyse game result as follows.
Every team has to play twice with the same opponent yielding Score1 and Score2.
I have to add total score of each player on a table 2 shown below.
The main problem is the number of team will be changing. If a team is added then every team will also play with the new team.
So, I want to dynamically add those team scores no matter how many times they played.
I have list of team in another sheet and this first data is dynamically generated based upon the teams listed on the other sheet.
Since the player can be added or removed, the number of scores we need to take will also be changed. That means the position(cell address) of a player in the sheet changes as a player is added or removed.
May be I am explaining more than required. If required more information, I am ready here.


ABCDEFGHIJKLMNOPQRS
1John Vs JaneJohn Vs JosephJohn Vs Regina
2TeamsScore1Score2Tie?N/R?TeamsScore1Score2Tie?N/R?TeamsScore1Score2Tie?N/R?
3John2536John3529John3842
4Jane2829Joseph4632Regina4233
5
6Jane Vs JosephJane Vs ReginaJoseph Vs Regina
7TeamsScore1Score2Tie?N/R?TeamsScore1Score2Tie?N/R?TeamsScore1Score2Tie?N/R?
8Jane2552Jane4036Joseph4236
9Joseph3641Regina3251Regina4441
10

<colgroup><col span="2"><col><col><col span="2"><col span="7"><col><col span="6"></colgroup><tbody>
</tbody>


Score1Score2
John
Jane
Joseph
Regina

<tbody>
</tbody>
 
I am getting Run-time Error 1004
Application defined or object defined error

When I click Debug, it yellow highlights line
c.Offset(, 2).Value = c.Offset(, 2).Value + f.Offset(n, 1).Value

Even if there is error, it sums the values. But, it adds 0 to the next empty cells of For columns of both Score1 and Score2 as shown in the table below.
Score1Score2
ForAgainstForAgainst
John145691815.6
Jane12116317.512.9
Joseph15316111.614.1
Regina14917513.117.6
00

<tbody>
</tbody>

What did I do wrong?
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
it is possible that under regina you have blank spaces
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top