How to Countif for the current week

Mista_sav

Board Regular
Joined
Aug 18, 2019
Messages
69
Office Version
  1. 2016
Platform
  1. Windows
  2. Web
Hi Team,

i have the following formula that counts dates if they are todays date

=COUNTIF('5 Days Post Settlement'!D11:D1999,TODAY())

How can i change this so it counts the dates in the current week instead (Mon-Sun)?

Technically it is pulling from multiple sheets and this is the full formula, i just used the above section to make it less clunky haha

=COUNTIF('5 Days Post Settlement'!D11:D1999,TODAY())+COUNTIF('6 Weeks Post Settlement'!D11:D1999,TODAY())+COUNTIF('3 Months Post Settlement'!D11:D1999,TODAY())+COUNTIF('6 Months Post Settlement'!D11:D1999,TODAY())+COUNTIF('12 Months Post Settlement'!D11:D1999,TODAY())+COUNTIF('18 Months Post Settlement'!D11:D1999,TODAY())+COUNTIF('24 Months Post Settlement'!D11:D1999,TODAY())+COUNTIF('30 Months Post Settlement'!D11:D1999,TODAY())+COUNTIF('36 Months Post Settlement'!D11:D1999,TODAY())
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
For single sheet
Code:
=SUMPRODUCT(COUNTIF('5 Days Post Settlement'!D11:D1999,TODAY()+CHOOSE(WEEKDAY(TODAY()),1,0,-1,-2,-3,-4,-5)+{0,1,2,3,4,5,6}))
For multiple sheet, use this formula, but adjust the sheet name. But it is not a good choice, with such long formula.
Using VBA, with a button instead.
 
Upvote 0
For single sheet
Code:
=SUMPRODUCT(COUNTIF('5 Days Post Settlement'!D11:D1999,TODAY()+CHOOSE(WEEKDAY(TODAY()),1,0,-1,-2,-3,-4,-5)+{0,1,2,3,4,5,6}))
For multiple sheet, use this formula, but adjust the sheet name. But it is not a good choice, with such long formula.
Using VBA, with a button instead.
 
Upvote 0
Im not skilled with writing the code for VBA Sorry. I have input them though form pre written codes. Thanks again mate
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have recent version with the LET function, try
Excel Formula:
=LET(r,'5 Days Post Settlement'!D11:D1999,t,TODAY(),COUNTIFS(r,">"&t-WEEKDAY(t,2),r,"<"&t+8-WEEKDAY(t,2)))

Otherwise try
Excel Formula:
=COUNTIFS('5 Days Post Settlement'!D11:D1999,">"&TODAY()-WEEKDAY(TODAY(),2),'5 Days Post Settlement'!D11:D1999,"<"&TODAY()+8-WEEKDAY(TODAY(),2))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

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