COUNTIF and weekdays

Shinano

Board Regular
Joined
Dec 5, 2004
Messages
62
I have a range A1:A31 listing the weekdays of a month. I need to count weekdays in this range in one cell and weekend days in another cell.

I am trying to come up with a formular using COUNTIF, but for some reason I can not get it right.

Any advice is appreciated.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

MarkAndrews

Well-known Member
Joined
May 2, 2006
Messages
1,963
Multiple countif's

=countif(a:a, "Monday")

=countif(a:a, "Tuesday")etc
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
If A1:A31 contain dates then you can count weekdays with

=SUMPRODUCT(--(WEEKDAY(A1:A31,2)<6),--(A1:A31<>""))

and the weekends with

=SUMPRODUCT(--(WEEKDAY(A1:A31,2)>=6),--(A1:A31<>""))
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,302
Office Version
  1. 365
Platform
  1. Windows
Barry,

Is the European version of Excel different than the US version? On our version, the Weekday function returns 1 for Sunday and 7 for Saturday, so the formulas you posted would need some tweaking to work.


EDIT: Barry pointed out to me the second argument of the WEEKDAY fucnion, which accounts for this.
 

Shinano

Board Regular
Joined
Dec 5, 2004
Messages
62
Thank you for the swift reply. I really appreciate it.

On more question, Barry. What are the: -- ?

I am sorry, but it has been some time since I have used Excel and my skills are pretty rusty.

Again, thanks a lot.
 

Forum statistics

Threads
1,136,584
Messages
5,676,659
Members
419,638
Latest member
GlenMc52

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