Count based on 2 cell ranges being within certain date ranges

AlexJames

New Member
Joined
Aug 20, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hey there!

I'm reviewing some customer data and trying to count the number of orders placed by customers within certain months based on the date they were acquired.

I've got the start and end dates for each month plotted out in Columns C and E in one sheet. In another sheet I've got customer IDs on each row, the number of orders they placed plotted as columns with the dates they placed them as values.

The only way I can think to get the data I want pulling through is by using an IF and COUNTIFS statement which looks as follows, but it's not working:

=IF(AND(Sheet1!B:B>=C2,Sheet1!B:B<=E2),COUNTIFS(Sheet1!B:BQ,">="&C2,Sheet1!B:BQ,"<="&E2))

Does anyone have any suggestion on formulas to get the data I'm trying to see?

Thanks!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Welcome to the MrExcel board!

You are familiar with your data and layout, but we are not. Your question would most likely be a lot clearer and elicit responses if you provided some small sample dummy data & the expected result(s) manually entered with XL2BB and explain again in relation to that sample.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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