Formula to count between 2 numbers matching month

umirin

Board Regular
Joined
Jul 31, 2016
Messages
58
Office Version
  1. 365
Platform
  1. Windows
hi all need help with a formula that can count between 2 numbers and match date you can see my current formulas are done manually just seeing if there is an easier way.


Excel 2016 (Windows) 32 bit
ABCDEF
1DateChange
2Friday, 1 January 20162.00
3Saturday, 2 January 20164.00DateOver 2 but Under 5
4Sunday, 3 January 20161.00Janurary3
5Monday, 4 January 20163.00March2
6Tuesday, 5 January 20165.00July4
7Wednesday, 6 January 20164.00
8Tuesday, 1 March 20167.00
9Wednesday, 2 March 20163.00
10Thursday, 3 March 20166.00
11Friday, 4 March 20169.00
12Saturday, 5 March 20164.00
13Sunday, 6 March 20162.00
14Wednesday, 13 July 20168.00
15Thursday, 14 July 20163.00
16Friday, 15 July 20167.00
17Saturday, 16 July 20163.00
18Sunday, 17 July 20165.00
19Monday, 18 July 20162.00
20Tuesday, 19 July 20163.00
21Wednesday, 20 July 20164.00
22Thursday, 21 July 20167.00
test
Cell Formulas
RangeFormula
F4=COUNTIFS($B$2:$B$7,">2",$B$2:$B$7,"<5")
F5=COUNTIFS($B$8:$B$13,">2",$B$8:$B$13,"<5")
F6=COUNTIFS($B$14:$B$22,">2",$B$14:$B$22,"<5")
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi, assuming those dates in column A are proper excel dates with special formatting and that you can change the months in E4:E7 to excel dates (the first of each month) then you could try something like this.


Excel 2013
ABCDEF
1DateChange
2Friday, 01 Jan 20162
3Saturday, 02 Jan 20164DateOver 2 but Under 5
4Sunday, 03 Jan 20161Jan-163
5Monday, 04 Jan 20163Mar-162
6Tuesday, 05 Jan 20165Jul-164
7Wednesday, 06 Jan 20164
8Tuesday, 01 Mar 20167
9Wednesday, 02 Mar 20163
10Thursday, 03 Mar 20166
11Friday, 04 Mar 20169
12Saturday, 05 Mar 20164
13Sunday, 06 Mar 20162
14Wednesday, 13 Jul 20168
15Thursday, 14 Jul 20163
16Friday, 15 Jul 20167
17Saturday, 16 Jul 20163
18Sunday, 17 Jul 20165
19Monday, 18 Jul 20162
20Tuesday, 19 Jul 20163
21Wednesday, 20 Jul 20164
22Thursday, 21 Jul 20167
Sheet1
Cell Formulas
RangeFormula
F4=COUNTIFS(A:A,">="&E4,A:A,"<="&EOMONTH(E4,0),$B:$B,">2",$B:$B,"<5")
 
Upvote 0
Hi,

you could try COUNTIFS($B:$B,">2",$B:$B,"<5",TEXT($B:$B,"mmmm")=$E4). Press ctrl+shift+enter as this is an array formula. I'm not sure of the result tho...
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,011
Members
452,374
Latest member
keccles

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