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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
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")))
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,448
Members
448,966
Latest member
DannyC96

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