Sum values from arguments registered in cells

quemuenchatocha

Board Regular
Joined
Aug 4, 2021
Messages
50
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Good day

I need some help. I am trying to calculate the cumulative grades obtained by each of the students (5), in each of the subjects taken (9). For example if I select student Abby (D17) from a drop down list and I want to know her cumulative grade recorded in chemistry (D18), for cell D20 I should get the total which would correspond to 11. However, I have tried different combinations of INDEX+MATCH, OFFSET and SUMIFS, and none of them has given me results, I think I am failing in some calculation.

Bakery Shopping List - STARTER.xlsm
ABCDEFGHIJK
1
2
3NameMathematicsPhysicsChemistrySportsAlgebraHistoryGeographyFrenchComputers
4Abby234533422
5Bill551543325
6Cathy342534244
7Derek433545155
8Bill523535241
9Abby424554242
10Emily214522223
11Abby333511333
12Derek042532211
13Cathy351531322
14313227503130242928
15
16
17Name:Abby
18SubjectChemistry
19
20Total:
21
Original data
Cell Formulas
RangeFormula
B14B14=SUBTOTAL(109,[Mathematics])
C14C14=SUBTOTAL(109,[Physics])
D14D14=SUBTOTAL(109,[Chemistry])
E14E14=SUBTOTAL(109,[Sports])
F14F14=SUBTOTAL(109,[Algebra])
G14G14=SUBTOTAL(109,[History])
H14H14=SUBTOTAL(109,[Geography])
I14I14=SUBTOTAL(109,[French])
J14J14=SUBTOTAL(109,[[Computers ]])
Cells with Data Validation
CellAllowCriteria
D17List=$M$3:$M$7
D18List=$B$3:$J$3


Could you please give me a hint about the best way to perform this calculation, I can not add up the cumulative grades of each of the students obtained in each of their subjects taken.

Thank you very much for your attention.

PS. I am using Excel 365 version
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
How about:

Dante Amor
ABCDEFGHIJ
1
2
3NameMathematicsPhysicsChemistrySportsAlgebraHistoryGeographyFrenchComputers
4Abby234533422
5Bill551543325
6Cathy342534244
7Derek433545155
8Bill523535241
9Abby424554242
10Emily214522223
11Abby333511333
12Derek042532211
13Cathy351531322
14313227503130242928
15
16
17Name:Abby
18SubjectChemistry
19
20Total:11
Hoja6
Cell Formulas
RangeFormula
D20D20=SUMPRODUCT((A4:A13=D17)*(Table1[[#Headers],[Mathematics]:[Computers ]]=D18)*(B4:J13))
 
Upvote 0
Solution
Or if you want all the sums of all the students you can do it with a pivot table:

1628208383967.png
 
Upvote 0
Another option.

quemuenchatocha.xlsm
ABCDEFGHIJ
1
2
3NameMathematicsPhysicsChemistrySportsAlgebraHistoryGeographyFrenchComputers
4Abby234533422
5Bill551543325
6Cathy342534244
7Derek433545155
8Bill523535241
9Abby424554242
10Emily214522223
11Abby333511333
12Derek042532211
13Cathy351531322
14Total313227503130242928
15
16
17Name:Abby
18SubjectChemistry
19
20Total:11
Sheet1
Cell Formulas
RangeFormula
B14B14=SUBTOTAL(109,[Mathematics])
C14C14=SUBTOTAL(109,[Physics])
D14D14=SUBTOTAL(109,[Chemistry])
E14E14=SUBTOTAL(109,[Sports])
F14F14=SUBTOTAL(109,[Algebra])
G14G14=SUBTOTAL(109,[History])
H14H14=SUBTOTAL(109,[Geography])
I14I14=SUBTOTAL(109,[French])
J14J14=SUBTOTAL(109,[[Computers ]])
D20D20=SUMIF(Table1[Name],D17,INDIRECT("Table1["&D18&"]"))
 
Upvote 0
Dear @DanteAmor, thank you very much for your valuable collaboration, it has helped me a lot to solve the doubts I had about this procedure, a big hug!
 
Last edited by a moderator:
Upvote 0
Dear @Peter_SSs thank you for your contribution, your alternative is valuable to me. I wanted to ask you if it is possible you can help me explaining me how the part of the function where you incorporate INDIRECT("Table1["&D18&"]") works, I am relatively new to these issues, I know how INDIRECT works but I am a little confused about the argument "Table1["&D18&"]", especially the part that goes inside [...]. Thanks again!
 
Upvote 0
Dear @Peter_SSs thank you for your contribution, your alternative is valuable to me.
You are welcome. :)

I know how INDIRECT works but I am a little confused about the argument "Table1["&D18&"]", especially the part that goes inside [...].
Assuming that your table name is "Table1" then the syntax Table1[History] refers to the History column in the table (excluding the heading), Table1[Chemistry] refers to the Chemistry column etc.
By using INDIRECT here I am just feeding the subject from cell D18 into that syntax. So with the layout and values shown in post #4 my formula translates as follows

=SUMIF(Table1[Name],D17,INDIRECT("Table1["&D18&"]"))
becomes
=SUMIF(Table1[Name],D17,Table1[Chemistry])
=SUMIF(A4:A13,"Abby",D4:D13)
= 11
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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