COUNTIFS with on Dates

TheKramer79

New Member
Joined
Jan 30, 2025
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am trying to write a formula to count cells that fall within a date range that can change. I am setting the date range using the following: =CHOOSE(WEEKDAY(A1,1),A1-7,A1-8,A1-9,A1-10,A1-11,A1-12,A1-13) and =CHOOSE(WEEKDAY(A1,1),A1-1,A1-2,A1-3,A1-4,A1-5,A1-6,A1-7) where cell A1 is the user input cell. My problem is, in my COUNTIFS it will not recognize ANY reference to another cell for the date. I have even tried to type a date into another cell, ensuring that the cell is formatted the same as the report I am evaluating, and it still returns zero results. My COUNTIFS formula is =COUNTIFS('Outbound Log'!$C$2:$C$3000,">=1/19/2025",'Outbound Log'!$C$2:$C$3000,"<=1/25/2025",'Outbound Log'!$P$2:$P$3000,"=Shipped") where I need to replace the hard coded dates with cellular references.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
You are using text, not actual dates. The simplest fix would be:

Excel Formula:
=COUNTIFS('Outbound Log'!$C$2:$C$3000,">="&DATEVALUE("1/19/2025"),'Outbound Log'!$C$2:$C$3000,"<="&DATEVALUE("1/25/2025"),'Outbound Log'!$P$2:$P$3000,"=Shipped")

Personally I would put the start and end dates into cells and reference the cells in the formula.
 
Upvote 0
I need to replace the hard coded dates with cellular references
You mean something like this:

Book1
ABCDEP
131/01/2025Start19/01/2025
2End25/01/2025
3Count6
4
5
6DateStatus
717/01/2025Shipped
818/01/2025Shipped
919/01/2025Shipped
1020/01/2025Shipped
1121/01/2025
1222/01/2025Shipped
1323/01/2025Shipped
1424/01/2025Shipped
1525/01/2025Shipped
1626/01/2025Shipped
1727/01/2025Shipped
1828/01/2025Shipped
1929/01/2025Shipped
2030/01/2025Shipped
2131/01/2025Shipped
2201/02/2025Shipped
2302/02/2025Shipped
2403/02/2025Shipped
2504/02/2025Shipped
Outbound Log
Cell Formulas
RangeFormula
E1E1=CHOOSE(WEEKDAY(A1,1),A1-7,A1-8,A1-9,A1-10,A1-11,A1-12,A1-13)
E2E2=CHOOSE(WEEKDAY(A1,1),A1-1,A1-2,A1-3,A1-4,A1-5,A1-6,A1-7)
E3E3=COUNTIFS('Outbound Log'!$C$2:$C$3000,">="&$E$1,'Outbound Log'!$C$2:$C$3000,"<="&$E$2,'Outbound Log'!$P$2:$P$3000,"Shipped")
 
Upvote 0
You can shorten the formulas in E1 and E2 like this:
Book1
ABCDE
11/31/25Start1/19/25
2End1/25/25
3Count6
Outbound Log
Cell Formulas
RangeFormula
E1E1=INDEX(A1-SEQUENCE(7,,7),WEEKDAY(A1,1))
E2E2=INDEX(A1-SEQUENCE(7),WEEKDAY(A1,1))
E3E3=COUNTIFS('Outbound Log'!$C$2:$C$3000,">="&$E$1,'Outbound Log'!$C$2:$C$3000,"<="&$E$2,'Outbound Log'!$P$2:$P$3000,"Shipped")
 
Upvote 0

Forum statistics

Threads
1,226,114
Messages
6,189,052
Members
453,522
Latest member
Seeker2025

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