Count dates In the past 7 days

IssycrayG111

New Member
Joined
Jan 23, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
I am trying to count a cell if it has a date with the range of the past 7 days, and I do not want to count blank cells. This is the closest I have gotten =COUNTIF(G3:I3,">="&TODAY()-7)-COUNTBLANK(G3:I3), but that’s giving me a negative number and I am not sure why. I am not even really sure if this is the right formula. I need help!!
 

Attachments

  • Capture.PNG
    Capture.PNG
    45.3 KB · Views: 5

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
this maybe a real silly question, but why -countblank() at all? The countif should only count the dates in the range you have provided, if the cell is blank Excel will typically default to 1900 as the year so that is way outside of your 7 day range.
 
Upvote 0
this maybe a real silly question, but why -countblank() at all? The countif should only count the dates in the range you have provided, if the cell is blank Excel will typically default to 1900 as the year so that is way outside of your 7 day range.
Probably because I don’t really know what I’m doing. I did try it without the count blank but it still didn’t seem to work.
 
Upvote 0
Code:
=COUNTIF(A1:C1,">"&TODAY()-7)

works just fine for me.

1/23/2020​
1/20/2020​
1/1/2020​
2​
1/23/2020​
1​
12/12/2019​
1/23/2020​
1/19/2020​
2​
 
Upvote 0
Welcome to MrExcel.
Judging by the fact that your dates are all aligned left, I suspect that they are text rather than real dates. This would explain why your formula doesn't work.
You will need to convert them to real dates.
 
Upvote 0
Which is what the OP is getting. ;)
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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