View Single Post
  #8   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 Mon, 20 Aug 2018 18:17:29 +0100 schrieb Milo Bloom:

Now one last problem, If I change the date to 5 for weekend for some
reason it does not work properly. Seems again to be counting all dates,
including blanks.
I did change the display options and that worked.


if you have a zero in column A the weekday is Saturday and will be
counted.
Change the formula for weekends:
=SUMPRODUCT((WEEKDAY(A$2:A$32,2)5)*(A2:A320)*D$2 :D$32)/SUMPRODUCT((WEEKDAY(A$2:A$32,2)5)*(A2:A320))


Regards
Claus B.
--
Windows10
Office 2016