On Feb 28, 11:34 am, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> How about:
>
> =SUMPRODUCT(--(WEEKDAY($C$14:$AG$14)=7),--($C$16:$AG$16<>0))>0
>
> (I added $ to the stuff on row 16)
>
> (Your udf would have to be rewritten to process a range of dates and return an
> array of 1/0's or true/falses.)
>
>
>
>
>
> Enz wrote:
>
> > I am trying to find all Saturdays within a range(on row 14), and if a
> > Saturday is detected, then I would like to add the values in the
> > corresponding row for the Saturday only dates(available in row 16).
> > After going through the date range, and the total sum is zero, then I
> > would like to return false. I also am trying to avoid doing this via
> > a macro as it should be automatically re-calculated if a cell changes.
>
> > Currently I have the cell formatted as follows that will provide a
> > true or false response, if any Saturday is detected with values in the
> > corresponding row. I created an IsSaturday function, that seems to be
> > returning #value. The result is that the formula always produces the
> > result of false.
>
> > =IF(SUMIF($C$14:$AG$14,IsSaturday(),C16:AG16)<>0, TRUE, FALSE)
>
> > Below is the function I have coded:
>
> > Public Function IsSaturday(x As Date) As Boolean
>
> > If Weekday(x) = 7 Then
> > IsSaturday = True
> > Else
> > IsSaturday = False
> > End Function
>
> > Is there something I am missing here, or can it be done a better way?
>
> > Thanks & regards,
> > Enzo
>
> --
>
> Dave Peterson- Hide quoted text -
>
> - Show quoted text -
This does not seem to work, as the weekday works on a date as opposed
to a range of dates. I will have a look at what I might be able to do
with SUMPRODUCT or other functions. thanks,
|