Countifs Formula?

BMcDougall

New Member
Joined
Apr 8, 2013
Messages
4
I have a worksheet to track progress of a project I'm working on. A sample of it looks something like this:
Zone</SPAN>
Area</SPAN>
Step 1</SPAN>
Step 2</SPAN>
Step 3</SPAN>
1</SPAN>
Room 1</SPAN>
Complete</SPAN>
In Progress</SPAN>
Not Started</SPAN>
1</SPAN>
Room 2</SPAN>
Complete</SPAN>
Not Started</SPAN>
Not Started</SPAN>
1</SPAN>
Room 3</SPAN>
Not Started</SPAN>
In Progress</SPAN>
Not Started</SPAN>
2</SPAN>
Room 1</SPAN>
Complete</SPAN>
Complete</SPAN>
Complete</SPAN>
2</SPAN>
Room 2</SPAN>
In Progress</SPAN>
Not Started</SPAN>
Not Started</SPAN>
2</SPAN>
Room 3</SPAN>
Not Started</SPAN>
Not Started</SPAN>
Not Started</SPAN>
3</SPAN>
Room 1</SPAN>
Complete</SPAN>
Complete</SPAN>
Complete</SPAN>
3</SPAN>
Room 2</SPAN>
Complete</SPAN>
Complete</SPAN>
In Progress</SPAN>
3</SPAN>
Room 3</SPAN>
Not Started</SPAN>
Not Started</SPAN>
Not Started</SPAN>

<TBODY>
</TBODY>


What I want to do is create a totals sheet that counts cells if the zone range (A2:A10) equals 1,2, & 3 and if the range of steps (C2:E10) equals "Not Started", "In Progress", & "Complete". The sheet would look something like this:
Zone</SPAN>
Not Started</SPAN>
In Progress</SPAN>
Complete</SPAN>
Total % Complete</SPAN>
1</SPAN>
5</SPAN>
2</SPAN>
2</SPAN>
22%</SPAN>
2</SPAN>
5</SPAN>
1</SPAN>
3</SPAN>
33%</SPAN>
3</SPAN>
3</SPAN>
1</SPAN>
5</SPAN>
56%</SPAN>

<TBODY>
</TBODY>


I could isolate each range of cells for each zone and use a countif formula but my real sheet has 1695 cells to incorperate and the possibility of adding/removing rows. I assume I would be able to incorperate the entire range of cells into a countifs formula but cannot figure out how. Any suggestions?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi and welcome to MrExcel.

Does this work for you?...

Excel Workbook
ABCDEF
1ZoneAreaStep 1Step 2Step 3
21Room 1CompleteIn ProgressNot Started
31Room 2CompleteNot StartedNot Started
41Room 3Not StartedIn ProgressNot Started
52Room 1CompleteCompleteComplete
62Room 2In ProgressNot StartedNot Started
72Room 3Not StartedNot StartedNot Started
83Room 1CompleteCompleteComplete
93Room 2CompleteCompleteIn Progress
103Room 3Not StartedNot StartedNot Started
11
12
13ZoneNot StartedIn ProgressCompleteTotal % Complete
14152222.22%
15251333.33%
16331555.56%
17
Sheet2


The formula in B14 needs to be copied across and down, the formula in E14 needs to be copied down.
You will need to change the cell references to suit your layout.

I hope that helps.

Ak
 
Upvote 0
Excel Workbook
ABCDE
1ZoneAreaStep 1Step 2Step 3
21Room 1CompleteIn ProgressNot Started
31Room 2CompleteNot StartedNot Started
41Room 3Not StartedIn ProgressNot Started
52Room 1CompleteCompleteComplete
62Room 2In ProgressNot StartedNot Started
72Room 3Not StartedNot StartedNot Started
83Room 1CompleteCompleteComplete
93Room 2CompleteCompleteIn Progress
103Room 3Not StartedNot StartedNot Started
11
12
13
14ZoneNot StartedIn ProgressCompleteTotal % Complete
15152222%
16251333%
17331556%
Sheet1
 
Upvote 0
What I want to do is create a totals sheet that counts cells if the zone range (A2:A10) equals 1,2, & 3 and if the range of steps (C2:E10) equals "Not Started", "In Progress", & "Complete".

OK, just pseudocode here, but I am thinking it could be done like this:
Code:
For i = 1 to Zones
    CountIFS("A2:A" & row(xlup), ("A2:A" & row(xlup).Value = i), ("B2:B" & row(xlup), ("B2:B" & row(xlup).Value = "Not Started")))
    CountIFS("A2:A" & row(xlup), ("A2:A" & row(xlup).Value = i), ("B2:B" & row(xlup), ("B2:B" & row(xlup).Value = "In Progress")))
    CountIFS("A2:A" & row(xlup), ("A2:A" & row(xlup).Value = i), ("B2:B" & row(xlup), ("B2:B" & row(xlup).Value = "Completed")))
        ...)
Next i
 
Last edited:
Upvote 0
@Akashwani
Thanks for the welcome! This formula works perfectly, I wouldn't have thought to use a sumproduct.

@kevatarvind
This one also works just as well, this is closer to what I was thinking.

@James Snyder
Sorry man, I can't figure out how to get yours to work, but that's most likely because I'm a noob. Thanks though.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,203,632
Messages
6,056,439
Members
444,864
Latest member
Thundama

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