Link to home
Start Free TrialLog in
Avatar of towo2002
towo2002

asked on

How to calculate a summary with specific condition?

Dear all, I've a Excel table which looks like below

Type       Count
A        2
A        3
B        4
B        5
C        6
C        7
C        7

And I would like to followings output:

Type      Total
A      5
B      9
C      20

Is there any function to accomplish this?
Avatar of wshark83
wshark83
Flag of United Kingdom of Great Britain and Northern Ireland image

you can just do a pivot table in excel and it will give you the desired output:

in excel go to data
select pivot table and pivot chart wizard
click next
select the table range
click next
click layout
select the "Type" field in row and count in the data (this should now show Sum of count).
click ok
and then finish
yes, you can do Pivot table - check attached example
towo2002-sample.xlsx
Put A in Cell A10, B in A11 and C in A12, then put the below formula in cell B10 and copy down to row 11 and 12

=SUMIF($A$2:$A$8,A10,$B$2:$B$8)

It assumes that your data is in cells A2:B8 (headers in row 1)
Avatar of towo2002
towo2002

ASKER

Dear all,

How about I just have 4 types?  Let say A, B, C, D.  Is there any easy way to accomplish it?  Provit table is good but wanna prevent to use it.
ASKER CERTIFIED SOLUTION
Avatar of helpfinder
helpfinder
Flag of Slovakia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial