Countifs problem

ToniShinobi

New Member
Joined
Sep 19, 2008
Messages
27
Hello,

I'm somewhat new to Excel (used it before, but not heavily) but used to the concept of functions (I have written programs before). I'm trying to Count the number of Entries on a Sheet that match an Hour. Looking through the availiable functions i found COUNTIFS, which is exactly what I want. However, when I try to compare the Hour values within the COUNTIFS arguments, there is an error.

This is the function that I figured would work here:
=COUNTIFS(HOUR(Sheet1!G:G), HOUR(E6))

which should count all entries in column G where its HOUR matches the HOUR in E6 (all are time format). I do realize that in the example above there is only one comparison made and i'm using COUNTIFS instead of COUNTIF, but i'll be adding other comparisons to it once i get this first comparison working.

Help is appreciated!!!
- Toni
 
IT WORKS!

I tweaked your last code post since it was missing some parameters:

=SUM(
IF(ISNUMBER(cit!G:G),
IF(HOUR(cit!G:G)=HOUR(E5),
IF(cit!E:E=1,
1, 0), 0), 0))

When i pressed ctrl+shft+enter on the code posted, nothing happend since there were errors, but On this code it places curly braces around the function. What does that do?

Thanks so much for your time, i know this took alot of it!

I failed to drop some parens during the edit from SumProduct to Sum+If...
Code:
=SUM(
   IF(ISNUMBER(cit!G:G),
   IF(HOUR(cit!G:G)=HOUR(E6),
   IF(cit!E:E=1,
   IF(cit!F:F=1,
    1)))))

or without the test involving the F column...

Code:
=SUM(
   IF(ISNUMBER(cit!G:G),
   IF(HOUR(cit!G:G)=HOUR(E6),
   IF(cit!E:E=1,
    1))))

The curly braces indicate that you did apply control+shift+enter correctly. This key combination is used to signal to Excel that the formula in question must process array objects which I mentioned earlier when discussing CountIf and CountIfs. How about SumProduct? This function is programmed for processing array objects.
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,216,473
Messages
6,130,838
Members
449,597
Latest member
buikhanhsang

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