How to exclude Saturdays and Sundays for calculation

James01

Board Regular
Joined
Oct 29, 2008
Messages
124
Hi

I have a formula as below

=
Code:
COUNTIF(Sheet1!$AA$1:$AA$3000,TEXT(NOW()-1,"mm/dd/yy"))

How do I get this formula to skip saturday and sundays?

Thanks
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Fazza

MrExcel MVP
Joined
May 17, 2006
Messages
9,368
Well, the formula counts days using NOW()-1 so is checking the day before.

To exclude Saturdays and Sundays is excluding results when the day that the formula executes is Sunday or Monday.

So, maybe something like this? HTH, Fazza

Code:
=IF(OR(MOD(TODAY(),7)={1,2}),0,COUNTIF(Sheet1!$AA$1:$AA$3000,TEXT(NOW()-1,"mm/dd/yy")))
 

James01

Board Regular
Joined
Oct 29, 2008
Messages
124
Hi

Thanks for the reply, I think it will work.

Just to clarify, yes the formula counts the cells having yesterdays date. NOw what I want is that if yesterday was Saturday or Sunday then the answer is 0. This is what the modified formula does, correct?

Thanks again

Cheers
 

Forum statistics

Threads
1,171,213
Messages
5,874,391
Members
433,049
Latest member
piyushbund77

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
Top