Excel problem

Soldato
Joined
29 Mar 2007
Posts
4,068
Location
Manchester
For this array of data...

Code:
Activity	Hours
Activity 1	2
Activity 2	4
Activity 1	6
Activity 1	1
Activity 3	6
Activity 5	9
Activity 3	3
Activity 1	6
Activity 6	1
Activity 5	8

I want an equation that calculates the values in the second column here:

Code:
	Total
Activity 1	15
Activity 2	4
Activity 3	9
Activity 4	0
Activity 5	17
Activity 6	1

I'm sure there is a clever way of doing it with INDEX or MATCH, and I know you can use nested IF statements but if I had loads of activities it would be clunky. Anyone got a neat way of doing that?

Cheers
 
Yeah SUMIF does exactly this, in your example if you had the totals in the adjacent columns it would go

=SUMIF(A2:A11,C2,B2:B11)

Where A2:A11 is the range of cells you are searching for, C2 is the cell value you want to match and B2:B11 is the range you want to add the totals from.
 
Last edited:
Yeh, it does. Cheers guys. Knew there would be an easy way.

=SUMIF(A2:B11,"Activity 1",B2:B11)

First time I tried it I messed it up but got it working now.
 
I know this is solved, but in this instance I would be lazy and just create a pivot table.
 
Back
Top Bottom