Countif Formula with Multiple Criteria / Sumif?

DebbyH

New Member
Joined
Oct 13, 2015
Messages
8
Hello, I have a several worksheets that I am trying to compile summary data into.
Here is an example of one of the sheets that will feed into the summary page. Departments A, B, and C, fall into Category 1. Department D is Category 2, Department E is Category 3.

Item # Dept# Seller Revenue
1 A JD $100
2 A JD $75
3 B JD $10
4 C JD $30
5 D JD $200
6 E JD $300
7 B JD $10
8 F JD $600
9 C JD $10

In a separate sheet, I need to create a summary that COUNTS the number of occurrences for Cat 1, 2, 3, ..... and there respective revenue

Seller Cat 1 Cat 1 Rev Cat 2 Cat 2 Rev Cat 3 Cat 3 Rev
JD 6 $225 1 $200 1 $300


I was thinking a countif(b1:b10, "A") + Countif(b1:b10:, "B") + ...... for the count of the department, but not sure how to count for the revenue.

Anyway, help is needed.

Thank you in advance.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I would add three columns to your non summary worksheet with these formulas,

=IF(B2="A",D2,IF(B2="B",D2,IF(B2="C",0))) (In E)
=IF(B2="D",D2,0) (In F)
=IF(B2="E",D2,0) (In G)

and then for your Cat 1 Rev on your summary, just =SUM(E1:E10), Cat 2 =SUM(F1:F10), Cat 3 = SUM(G1:G10). If you don't like the extra columns being visible they can be hidden and still function.
 
Upvote 0
or just use SUMIF, for the third argument in the formula you can just put in the range of numbers you want to add and it works SUMIF(b1:b10, "A",D1:D10) etc.
 
Upvote 0
Try something like this:

For the count Cat 1:


=SUMPRODUCT(--($A$2:$A$10={"A","B","C"}))

For the SUM Cat 1:

=SUMPRODUCT(--($A$2:$A$10={"A","B","C"})*$C$2:$C$10)

For the others with only one Department, you could use the same or a simple COUNTIFS or SUMIFS like:

=COUNTIF($A$2:$A$10,"D") and =SUMIF($A$2:$A$10,"D",C2:C10)

If you can add a column to specify the Category, you could use a simple COUNTIF or COUNTIFS and SUMIF/SUMIFS for the formula.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,668
Messages
6,120,825
Members
448,990
Latest member
rohitsomani

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