Multiple Countif

kmrowlan

Board Regular
Joined
Aug 5, 2009
Messages
80
I am attempting to do a multiple countif statement but think I need to go another direction. Currently I have:

=COUNTIF(C53:C58,">="&D1020)-COUNTIF(C53:C58,">"&D1021)

Which counts if the date is between two time frames but I need to added one more variable from another column. I need to count if the date falls within that range and it belongs to a particular department.

Any suggestions?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Assuming the Department is in column B for example...

Try
=SUMPRODUCT(--(B53:B58="department x"),--(C53:C58>=D1020),--(C53:C58<=D1021))
 
Upvote 0
I am attempting to do a multiple countif statement but think I need to go another direction. Currently I have:

=COUNTIF(C53:C58,">="&D1020)-COUNTIF(C53:C58,">"&D1021)

Which counts if the date is between two time frames but I need to added one more variable from another column. I need to count if the date falls within that range and it belongs to a particular department.

Any suggestions?
Try one of these...

For ANY version of Excel:

D1022 = some depatment

=SUMPRODUCT(--(X53:X58=D1022),--(C53:C58>=D1020),--(C53:C58<=D1021))

For Excel 2007 and later:

=COUNTIFS(X53:X58,D1022,C53:C58,">="&D1020,C53:C58,"<="&D1021)

Replace X53:X58 with the actual range.
 
Upvote 0
the sumrpoduct results in #VALUE! see the formula:

=SUMPRODUCT(--(G53:G55="IN Distribution"),--(C53:C58>=D1020),--(C53:C58<D1021))

and the countifs results in #name? see formula below:

=countifs(G53:G55,"IN Distribution",C53:C58,">="&D1020,C53:C58,"<="&D1021)

Can you see where I have done something wrong?
 
Upvote 0
the sumrpoduct results in #VALUE! see the formula:


=SUMPRODUCT(--(G53:G55="IN Distribution"),--(C53:C58>=D1020),--(C53:C58<D1021))< p>
and the countifs results in #name? see formula below:

=countifs(G53:G55,"IN Distribution",C53:C58,">="&D1020,C53:C58,"<="&D1021)

Can you see where I have done something wrong?
What version of Excel are you using? It's probably not Excel 2007 or later which might be why you get a #NAME? error for the COUNTIFS version.

I can't tell what your SUMPRODUCT looks like. Some of it looks like it's missing? However, one of the ranges is not the same size.

Try this:

=SUMPRODUCT(--(G53:G58="IN Distribution"),--(C53:C58>=D1020),--(C53:C58<=D1021))
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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