Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / February 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Enz - 28 Feb 2007 16:36 GMT
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, if 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(DateValue(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 - 28 Feb 2007 16:53 GMT
Check your initial post.

> 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
[quoted text clipped - 25 lines]
> Thanks & regards,
>   Enzo

Signature

Dave Peterson

Bob Phillips - 28 Feb 2007 16:56 GMT
=IF(SUMPRODUCT(--(WEEKDAY(14:14)=6))>0,SUMPRODUCT(--(WEEKDAY(14:14)=6),16:16))

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

>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
[quoted text clipped - 25 lines]
> Thanks & regards,
>  Enzo
Bob Phillips - 28 Feb 2007 17:16 GMT
I mean =7 not =6

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> =IF(SUMPRODUCT(--(WEEKDAY(14:14)=6))>0,SUMPRODUCT(--(WEEKDAY(14:14)=6),16:16))
>
[quoted text clipped - 27 lines]
>> Thanks & regards,
>>  Enzo
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.