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
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,385
Messages
5,601,331
Members
414,446
Latest member
CRAVIN

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