How to sum up the data which match two criteria?

M

Macneed

How to sum up the data which match two criteria?

e.g.
A Home BB Call 80
B Office Mobile 8370
C Home Mobile 870
D Home BB Call 860
E Office BB Call 850
G Home Mobile 480
H Office Mobile 380
I Home BB Call 10

Is it possible to sum up all match "Home" and "Mobile" by a formula?
870 + 480

Thanks a lot
 
P

Pete_UK

Assuming your first description is in column B, your second description
in column C and your numbers (cost?) in column D, and that your data
spans rows 1 to 100 (adjust to suit), then try this formula in G1:

=SUM(IF((B$1:B$100="Home")*(C$1:C$100="Mobile"),D$1:D$100,0))

This is an array formula, which means that once you have typed it in
(or subsequently edit it) you need to use CTRL-SHIFT-ENTER instead of
just ENTER. If you do this correctly, then Excel will wrap curly braces
{ } around the formula - you must not type these yourself.

You could enter "Home" into cell E1 and "Mobile" into cell F1, and then
the formula could be changed to:

=SUM(IF((B$1:B$100=E1)*(C$1:C$100=F1),D$1:D$100,0))

(again, CSE to commit). This formula could be copied down column G,
with appropriate entries in E and F to give you sums between other
destinations.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top