COUNTIFS with criteria for status of work item

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
579
Office Version
  1. 2016
In Sheet 1 I have
Column P = WIP
Column R = Testing
Column Z = Completed

In Sheet 2, from L164 downwards I have dates, 1/4/19,8/4/19, 15/4/19 etc

What I need is to count the number of occurances of each inthat week

So,

Order | W.I.P. | Testing | Completed
100001|1/4/19|10/4/19|14/4/19|
100002|05/04/19|
100003|08/04/19|23/4/19|

So in
01/04/19 week there would be 2 count of WIP, and 0 testing orcompleted
08/04/19 week there would be 2 in WIP, 0 in Testing, 1complete (as 1 in testing was completed same week)
15/04/19 week would be 1 in 2 in WIP
22/04/19 week 1 in WIP, 1 in Testing
(So when completed only counts for that week.

The answers will be in separate cells from M163 (WIP), N163(Testing), 0163 (Completed)

Many thanks

 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Excel 2010
LMNO
163Week Beginning W.I.P. Testing Completed
16401/04/2019200
16508/04/2019201
16615/04/2019200
16722/04/2019110
16829/04/2019110

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
M164=SUM(COUNTIFS(Sheet1!P:P,"<"&$L164+7,Sheet1!R:R,">"&$L164+7),COUNTIFS(Sheet1!P:P,"<"&$L164+7,Sheet1!R:R,""))
N164=SUM(COUNTIFS(Sheet1!R:R,"<"&$L164+7,Sheet1!Z:Z,">"&$L164+7),COUNTIFS(Sheet1!R:R,"<"&$L164+7,Sheet1!Z:Z,""))
O164=SUM(COUNTIFS(Sheet1!Z:Z,"<"&$L164+7,Sheet1!Z:Z,">="&$L164))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Thank you for this. This does 99% of what I need.

The only scenario I have come across is if I was in WIP or Testing on 01/04/19 and Completed on 05/04/19, it should then not record it in WIP (only latest status that week (Also amended from 7 to 6 as for week, as it seemed to be counting Mon-Mon rather than Mon-Sun)

Excel 2010
L
M
N
O
163
Week Beginning
W.I.P.
Testing
Completed
164
01/04/2019
2
165
08/04/2019
2
1
166
15/04/2019
2
167
22/04/2019
1
1
168
29/04/2019
1
1

<tbody>
</tbody>
Sheet2


Worksheet Formulas
Cell
Formula
M164
=SUM(COUNTIFS(Sheet1!P:P,"<"&$L164+7,Sheet1!R:R,">"&$L164+7),COUNTIFS(Sheet1!P:P,"<"&$L164+7,Sheet1!R:R,""))
N164
=SUM(COUNTIFS(Sheet1!R:R,"<"&$L164+7,Sheet1!Z:Z,">"&$L164+7),COUNTIFS(Sheet1!R:R,"<"&$L164+7,Sheet1!Z:Z,""))
O164
=SUM(COUNTIFS(Sheet1!Z:Z,"<"&$L164+7,Sheet1!Z:Z,">="&$L164))

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,938
Members
448,534
Latest member
benefuexx

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