View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.misc
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Count Weekdays and Weekends separate & < a given cell.

Hi Milo,

Am Tue, 21 Aug 2018 18:54:03 +0100 schrieb Milo Bloom:

=SUMPRODUCT(--(WEEKDAY($A$2:$A$32,2)<=1),D$2:D$32)/SUMPRODUCT(N(WEEKDAY($A$2:$A$32,2)<=1))


WEEKDAY(Range,2) is for week start with Monday.
When you use <=1 you only count and sum the values for Monday.
1 =Monday
2=Tuesday
3 = Wednesday
..
..
..

Try:
=SUMPRODUCT(--(WEEKDAY($A$2:$A$32,2)<3),D$2:D$32)/SUMPRODUCT(N(WEEKDAY($A$2:$A$32,2)<3))
That will calculate the average for values in column D for Monday and
Tuesday.


Regards
Claus B.
--
Windows10
Office 2016