CONTIF 2 criterias

StartingOut

Board Regular
Joined
Feb 1, 2011
Messages
92
Hi, I have workbook that has data on my "DailyMUI's" sheet which gets sent to my "Summary" sheet. the data collected is the date which is put in B2, then on my "Summary" sheet I have data that pulls a time stamp from the "DailyMUI's" sheet. On my "Summary" sheet I need to count the number of times an entry in C:C is durring a certain time frame and also check to see if the data for the line item is equal to "Summary" date in cell B2.

So if sheet DailyMUI's colum C:C has a time <17:00 and it also has a date equal to what is in B2 on the Summary sheet then count all of the entries.

The essentialy tells me how many line items where created durring business hours and how many after hours.

=COUNTIF('DailyMUI''s'!C:C,"<17:00",'Summary'!B2)-COUNTIF('DailyMUI''s'!C:C,"<7:00",'Summary'!B2)
 
I have figured it out,

The formula I needed was

=COUNTIFS('DailyMUI''s'!C:C,"<17:00",'DailyMUI''s'!A:A,B2)-COUNTIFS('DailyMUI''s'!C:C,"<7:00",'DailyMUI''s'!A:A,B2)
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I have figured it out,

The formula I needed was

=COUNTIFS('DailyMUI''s'!C:C,"<17:00",'DailyMUI''s'!A:A,B2)-COUNTIFS('DailyMUI''s'!C:C,"<7:00",'DailyMUI''s'!A:A,B2)
Here, try it like this...

Use cells to hold the time boundaries:
  • A1 = 7:00 AM
  • A2 = 5:00 PM
Then the formula becomes:

=COUNTIFS('DailyMUI''s'!C:C,">"&A1,'DailyMUI''s'!C:C,"<"&A2,'DailyMUI''s'!A:A,B2)

You do realize that you're excluding both the start time and the end time from the count? The time criteria is count if the time is AFTER 7:00 AM and BEFORE 5:00 PM.
 
Upvote 0

Forum statistics

Threads
1,224,621
Messages
6,179,938
Members
452,949
Latest member
beartooth91

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