Sum corresponding row values for Saturday only dates within a date range

E

Enz

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, if any Saturday is detected with values in the
corresponding row. I created a 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 String) 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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top