Multiple COUNTIFS

tera dactil

New Member
Joined
May 18, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello everyone. I have a table with two columns that I need to query: Effective Date, Effective Time.

AB
02/02/202007:01
05/03/202017:59
02/01/202008:00
02/02/202013:01

I also have a lookup table which delineates a 24 hour interval:

AB
Hour 0 start00:01
Hour 0 end00:59
Hour 1 start01:00
Hour 1 end01:59

etc

So, my objective is to count how many events in the Table fall within the hourly intervals. So that i can build a matrix in a summary worksheet that gives volumes by hour:

00:00-00:59 9
01:00-01:59 2
02:00-02:59 7

etc

I can get COUNTIFS to work by doing this:

=COUNTIFS('Table1'!A2:A100,">="&'Table2'!A1,'Table1'!A2:A100,"<="&'Table2'!A2
(this would be for the first result row. Then i replicate it with different lookups for the successive hourly intervals.

Obviously, the limitation here is that the array lookup in Table1 is static; I'd ideally like to have a match on the date on my summary worksheet against any qualifying dates in Table1. I've spent a day trying to use a combination of COUNTIFS, INDEX, MATCH, SUMPRODUCT, and it has stumped me. Any help would be much appreciated!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,870
Office Version
  1. 2010
Platform
  1. Windows
What does the summary sheet look like? Would you post it with some expected results?
 

tera dactil

New Member
Joined
May 18, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Certainly, yes. Attached is a screen capture of what my customer wants to see.
 

Attachments

  • Annotation 2020-05-19 074050.png
    Annotation 2020-05-19 074050.png
    35.5 KB · Views: 5

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,870
Office Version
  1. 2010
Platform
  1. Windows
I modified your hour listing so it's easier to work with. If you don't like it, hide the column.

AB
2/2/20207:01
5/3/202017:59
2/1/20208:00
2/2/202013:01
5/3/202016:42
5/3/202016:07
5/4/20206:51
5/4/20208:33
5/4/20208:44


hours5/1/20205/2/20205/3/20205/4/2020
0:0000
1:0000
2:0000
3:0000
4:0000
5:0000
6:0001
7:0000
8:0002
9:0000
10:0000
11:0000
12:0000
13:0000
14:0000
15:0000
16:0020
17:0010
18:0000
19:0000
20:0000
21:0000
22:0000
23:0000
0:00


Cell Formulas
RangeFormula
D4D4=COUNTIFS(Table1!$A$2:$A$100,"="&D$3,Table1!$B$2:$B$100,">="&$A4,Table1!$B$2:$B$100,"<"&$A5)
 

tera dactil

New Member
Joined
May 18, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
WOW. Thank you so much! I was WAY overthinking this, wasn't i?

Much gratitude, yky
 

Watch MrExcel Video

Forum statistics

Threads
1,129,984
Messages
5,639,391
Members
417,085
Latest member
Aman2626

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
Top