Countif Dates fall within Range

evanscm3

New Member
Joined
Nov 4, 2009
Messages
12
Hi,
Sorry to come in with another CountIF question, but I checked some other threads and couldn't find anything that works for this..

I need to count the number of rows that contains a date that falls within the last 7 days. The dates are in one column (J in this example) - I am trying the below which just gives me 0s
HTML:
=COUNTIF(J4:J26,">=(today()-7)")

Any help appreciated.
Thanks
Chris
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
that works fantastically - thanks.
is it possible to add the top level of the range in the formula or does that fall beyond the scope of CountIF

for example if date is >=today()-7 & < today ()<TODAY() p ?<>
 
Upvote 0
You can use 2 COUNTIFS like this

=COUNTIF(J4:J26,">="&today()-7)-COUNTIF(J4:J26,">="&today())

which counts the last 7 days (not including today)

or you can use SUMPRODUCT, i.e.

=SUMPRODUCT((J4:J26>=TODAY()-7)*(J4:J26< TODAY()))<TODAY()))< p>
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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