CountIF between dates against specific criteria

J_Kelly

New Member
Joined
Feb 25, 2022
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
I am trying to use a count if to count the number of times a date appears within a range of columns while that same count also follows an additional criteria.

The below formula to me should work, but i have had to break it down to column by column to get a value.

=COUNTIFS('Sheet1'!AK:BM,">="&D14,'Sheet1'!AK:BM,"<="&D15,'Sheet1'!BU:BU,"Location")

Where D14 and D15 are a date range that will change weekly.

If I remove the Location option the count works however as soon as I reintroduce it the formula fails.

Thank you
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi & welcome to MrExcel.
With countifs all the ranges must be the same size, try it like
Excel Formula:
=SUMPRODUCT((Sheet1!AK2:BM1000>=D14)*(Sheet1!AK2:BM1000<=D15)*(Sheet1!BU2:BU1000="Location"))
 
Upvote 0
Hi & welcome to MrExcel.
With countifs all the ranges must be the same size, try it like
Excel Formula:
=SUMPRODUCT((Sheet1!AK2:BM1000>=D14)*(Sheet1!AK2:BM1000<=D15)*(Sheet1!BU2:BU1000="Location"))
Thank you, its worked perfectly! I saw the SUMPRODUCT function around but didn't understand how it worked.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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