COUNTIFS Hours and minutes in range

jao1310

New Member
Joined
Jul 22, 2019
Messages
2
Duration hours:mins
Column A
Type of interruption
Column B
Number of cust affected
Column C
Event day? Y/N
Column D
13:39
Unplanned
13
N
43.27
Unplanned 20
N
6:00
Planned
80
N

<tbody>
</tbody>

Hi,

The above table shows a sample of what I am doing.
I'm trying to count the number of instances that meets the following criteria:

Number of instances where Unplanned interruption occrured during none event day that are: (the formula on right is what I currently have on the table but is not working. It only displays "0". I just want to note that the time column (Column A) is formatted as [h]:mm;@

<8 hours
<strike></strike>
=COUNTIFS($A$4:$A$47,"<8:00",$B$4:$B$47,"Unplanned",$D$4:$D$47,"NO")
>8 hours and <12 hours
<strike></strike>
COUNTIFS($A$4:$A$47,">8:00",$A$4:$A$47,"<12:00",$B$4:$B$47,"Unplanned",$D$4:$D$47,"NO")<strike></strike>
=12 hours
<strike></strike>
=COUNTIFS($A$4:$A$47,"=12:00",$B$4:$B$47,"Unplanned",$D$4:$D$47,"NO")
>12 hours and <=24 hours
<strike></strike>
COUNTIFS($A$4:$A$47,">12:00",$A$4:$A$47,"<24:00",$B$4:$B$47,"Unplanned",$D$4:$D$47,"NO")
<strike style="background-color: transparent; border-collapse: collapse; color: rgb(34, 34, 34); font-family: Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: line-through; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; width: auto; word-spacing: 0px;"></strike>
36 to 48 hours
<strike></strike>
COUNTIFS($A$4:$A$47,">36:00",$A$4:$A$47,"=48:00",$B$4:$B$47,"Unplanned",$D$4:$D$47,"NO")
<strike style="background-color: transparent; border-collapse: collapse; color: rgb(34, 34, 34); font-family: Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: line-through; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; width: auto; word-spacing: 0px;"></strike>

<tbody>
</tbody>

Thank you.

Jao
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Welcome to the forums.

1) What does Column C have to do with?
2) Where do you want the answers to be displayed?
3) In Column D is it "NO" or just "N"?
4) Can you please paste your whole set of data (or a bit more data), along with your expected results?
 
Upvote 0
Hi

Thanks heaps for replying.

1) Sorry, column C has nothing to do with it, so maybe just disregard that one.
2.) Answers are displayed below the table.

3) Column D is "NO" not N (Sorry, I was in a hurry yesterday that I put "N" on my sample table, however on my orginal table, answers in Column D are either a YES or NO

4) The table that I provided yesterday is just a sample on how I presented the table and the data. Basically, what I want to do is to COUNT the (Criteria 1) number of 'Unplanned interruptions' on a (Criteria 2) certain range of duration, and that are (Criteria 3) Not a Major event day (so we're looking at the 'NO' answers).
I have a feeling that the problem is how Excel is seeing Time (hours: minutes). I formatted Column A as [h]:mm;@

Column A Column B Column D
Duration of interrution Type of interruption Did this occur on a major event day? YES/NO

12:00 Planned NO
6:00 Unplanned NO
12:35 Unplanned NO
43:51 Unplanned NO
32:22 Planned YES
14:24 Unplanned YES
18:21 Unplanned NO

Expected results (I changed the hour ranges as the previous one is incorrect)

Number of Unplanned interruptions (excluding major event days)
Parameter answer
<8 hours [1]
>8 hours and <=12 hours [0]
=12 hours [1]
>12 hours and <=24 hours [1]
>24 hours <=48 hours [1]

Thank you again.
 
Upvote 0
Will the below work? Copy/Paste the below into excel.

Criteria column cell G2 Formula:
Code:
=IF(ROWS($F$2:F2)=1,COUNTIFS($D$2:$D$8,"NO",$B$2:$B$8,"Unplanned",$A$2:$A$8,"<"&(F2/24)),COUNTIFS($D$2:$D$8,"NO",$B$2:$B$8,"Unplanned",$A$2:$A$8,">"&(F1/24),$A$2:$A$8,"<="&(F2/24)))

Duration (Hrs:Min)Planned/UnplannedNo. Of Cust AffectedEvent day?HoursCriteria
12:00PlannedBlank (For Now)No81
6:00UnplannedBlank (For Now)No120
12:35UnplannedBlank (For Now)No242
43:51UnplannedBlank (For Now)No481
32:22PlannedBlank (For Now)Yes
14:24UnplannedBlank (For Now)Yes
18:21UnplannedBlank (For Now)No

<colgroup><col><col span="2"><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,213,539
Messages
6,114,221
Members
448,554
Latest member
Gleisner2

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