#1   Report Post  
Junior Member
 
Posts: 19
Default Countif?

Hello, I want to count dates if they are weekday or weekend
Col A is Dates I.E. 1 Apr 18 to 30 Apr 18
Col B is Numbers normally 65 to 200
I want to count the number of weekday and weekend in Col B

Thanks in Advance

Milo
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Countif?

Hi Milo,

Am Fri, 6 Apr 2018 20:25:52 +0100 schrieb Milo Bloom:

Hello, I want to count dates if they are weekday or weekend
Col A is Dates I.E. 1 Apr 18 to 30 Apr 18
Col B is Numbers normally 65 to 200
I want to count the number of weekday and weekend in Col B


try:
=SUMPRODUCT(N(WEEKDAY(A1:A30,2)<6))
or
=SUMPRODUCT(--(WEEKDAY(A1:A31,2)<6),--(A1:A310))
for weekdays
and
=SUMPRODUCT(N(WEEKDAY(A1:A30,2)5))
or
=SUMPRODUCT(--(WEEKDAY(A1:A31,2)5),--(A1:A310))
for weekends



Regards
Claus B.
--
Windows10
Office 2016
  #3   Report Post  
Junior Member
 
Posts: 19
Default Weekdays & Weekends

Ok Thanks for that info, helped a bunch, and I cabbage d up something that sort of works. Is there any way to count single days? I.E Monday or Tuesday or Sunday, not just Weekdays or Weekends. This works to average Weekdays or Weekends.
=IF(SUMPRODUCT(N(WEEKDAY($A$2:$A$34,2)<6)),AVERAGE ($B$2:$B$30))
^
|
Changing this to other than 5 has
no impact.
That is Monday being "1" Tuesday "2"....

Thanks for the help everyone! :-)

Milo
  #4   Report Post  
Junior Member
 
Posts: 19
Default

Ok I got it :-)

=AVERAGE(IF(WEEKDAY($A$2:$A$32)=2,$D$2:$D$32))
^
|
Change as needed for desired day of week,
Sunday = 1. Mon =2 .......Sat = 7

A column is dates May 1 to May 31
D Column is Data
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif Q John Excel Worksheet Functions 2 February 28th 06 10:48 PM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 08:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"