Boring Exceltrackwo...
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Boring Exceltrackworld question

9 Posts
7 Users
0 Reactions
176 Views
Posts: 55
Free Member
Topic starter
 

Please Excel nerds, can you tell me how to get the sum of all values in one column which have the same value in another column? Lecturers have students in different classes and I want to know how many students they have in total. e.g.

Name | Number of Students
Smith | 20
Smith | 25
Jones | 15
Jones | 10
Jones | 7
Brown | 5
Brown | 20

Is it possible to have a single formula in a column which will do this? There are about 380 staff teaching about 2,000 classes.


 
Posted : 12/06/2013 9:53 am
Posts: 0
Free Member
 

You could use a pivot table.

That way you can isolate a variable to find trends easily without having to do any Visual Basic.

As long as you have saved the spreadsheet you can go to Insert, Pivot table, do it on a new worksheet and then drag and drop the variables to the table.

it may help to check out Exel help first. Once you get the hang of Pivot tables you will wonder how you ever worked without them.


 
Posted : 12/06/2013 9:58 am
Posts: 0
Free Member
 

Yep, a second vote for a pivot table.


 
Posted : 12/06/2013 10:08 am
Posts: 0
Free Member
 

=sumif(range,criteria,[sumrange])


 
Posted : 12/06/2013 10:11 am
Posts: 12079
Full Member
 

3rd vote!

Easiest way is:

1. Select all the data you want to use, including the column headers

2. Click on the convert to table button (on the main ribbon)

3. Select insert ribbon, then click on insert pivot table. Select the fields you want to use.


 
Posted : 12/06/2013 10:12 am
Posts: 27
Free Member
 

I'd use sumif because I hate pivot tables.
you'll need a column of the lecturers names though to refer to - they are the 'criteria' in the formula posted by annebr, range is the table you've posted above and sum range is the column of numbers.


 
Posted : 12/06/2013 10:16 am
Posts: 55
Free Member
Topic starter
 

Thanks, I'll look into pivot tables. Am I right in thinking that if I used sumif, I'd have to use a different formula for each teacher name?


 
Posted : 12/06/2013 10:27 am
Posts: 0
Free Member
 

yes that's right you have a row per teacher name and that formula by each name


 
Posted : 12/06/2013 10:34 am
Posts: 0
Free Member
 

You don't need a different formula if you go Sumif. You just need to have the correct cell references in each formula which can be achived by careful application of a few $ signs.

I'd go pivot for either a one off data analysis or if the teachers names change a lot. I'd go sumif if the teachers names are relatively stable but I want the spreadhseet to be a long standing tool.

Pivot tabels are useful for quick analysis but a bit clunky to use all the time as they tend to lose formatting and be a bit funny with links elsewhere.


 
Posted : 12/06/2013 10:54 am
Posts: 55
Free Member
Topic starter
 

PIVOT TABLES TO THE RESCUE! Thanks for your help


 
Posted : 12/06/2013 11:07 am