Struggling with COUNTIFS/COUNTIF with multiple criteria

craigs85

New Member
Joined
Jan 14, 2017
Messages
26
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone.
I am creating a spreadsheet to help me forecast time spent in projects.

I'm sure there must be a simpler formula to do what I need.

For every month, I want to count how many times a Project Name is being looked at. And then I want to multiply the number by the rate, which is different for each person.

So in the example below, Person 1 is spending Jan on Project A. This should be 3. Person 2 is also 3 in Project A, Person 2 is on Project A but their rate is 4.

You can see in the formula for Project A in C13, I've had to do a count for every person. This is the bit I think could be simpler, but I just don't know how? Is there a way?

Book1
ABCDEFGHIJKLMN
1PersonRateJanFebMarAprMayJunJulAugSepOctNovDec
2Person 13Project A
3Person 23Project A
4Person 34Project A
5Person 43.5Project B
6Person 52Project B
7Person 64Project A
8Person 72Project C
9Person 82Project C
10Person 93Project A
11Person 103Project B
12
13Project A17
14Project B8.5
15Project C4
Sheet1
Cell Formulas
RangeFormula
C13:C15C13=COUNTIF(C2,A13)*B2+COUNTIF(C3,A13)*B3+COUNTIF(C4,A13)*B4+COUNTIF(C5,A13)*B5+COUNTIF(C6,A13)*B6+COUNTIF(C7,A13)*B7+COUNTIF(C8,A13)*B8+COUNTIF(C9,A13)*B9+COUNTIF(C10,A13)*B10+COUNTIF(C11,A13)*B11
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
How about
Excel Formula:
=SUMIFS($B$2:$B$11,$C$2:$C$11,A13)
 
Upvote 0
I think that looks like its done what I need.
I was thinking about it all wrong wasn't it!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Ah, I found my first issue. And apologies, my example above was a very basic version of what I would like to achieve. I thought a solution to that might help me with my more detailed sheet.

So, rather than at a month level, I am breaking it down into weeks, and want to know the total for the month.

So in this example below, It returns #VALUE using the suggestion as I am now expanding the criteria range. Is there a nice way of doing this?

Book1.xlsx
ABCDEFGHIJKLMN
1Month 1Month 2Month 3
2PersonRateWeek 1Week 2Week 3Week 4Week 1Week 2Week 3Week 4Week 1Week 2Week 3Week 4
3Person 13Project AProject A
4Person 23Project AProject A
5Person 34Project AProject B
6Person 43.5Project B
7Person 52Project B
8Person 64Project A
9Person 72Project C
10Person 82Project C
11Person 93Project A
12Person 103Project B
13
14Month 1Month 2
15Project A#VALUE!
16Project B8.5
17Project C4
Sheet1
Cell Formulas
RangeFormula
C15C15=SUMIFS($B$3:$B$12,$C$3:$D$12,A15)
C16C16=COUNTIF(C4,A16)*B4+COUNTIF(C5,A16)*B5+COUNTIF(C6,A16)*B6+COUNTIF(C7,A16)*B7+COUNTIF(C8,A16)*B8+COUNTIF(C9,A16)*B9+COUNTIF(C10,A16)*B10+COUNTIF(C11,A16)*B11+COUNTIF(C12,A16)*B12+COUNTIF(C14,A16)*B14
C17C17=COUNTIF(C5,A17)*B5+COUNTIF(C6,A17)*B6+COUNTIF(C7,A17)*B7+COUNTIF(C8,A17)*B8+COUNTIF(C9,A17)*B9+COUNTIF(C10,A17)*B10+COUNTIF(C11,A17)*B11+COUNTIF(C12,A17)*B12+COUNTIF(C14,A17)*B14+COUNTIF(C15,A17)*B15
 
Upvote 0
You need sumproduct for that
Excel Formula:
=SUMPRODUCT($B$3:$B$12*($C$3:$D$12=A15))
With SUMIFS, the sum range and criteria range must be of equal size, you can't have a single column in 1 and 2 columns in the other.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,516
Messages
6,119,980
Members
448,934
Latest member
audette89

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