Thread: Counting hours
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
vanilla_bean_orange via OfficeKB.com vanilla_bean_orange via OfficeKB.com is offline
external usenet poster
 
Posts: 6
Default Counting hours

Hi again!!

Thanks for getting back

Tried but it comes up with repeated ########. Ive checked its not because
the cells too small.

Any ideas?

Theresa

Bob Phillips wrote:
How about this

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(INT(B29)&":"&INT(D29))))={2, 3,4,5,6}))-2
+(MAX(MOD(B29,1),F3)-MAX(MOD(B29,1),E3))*(WEEKDAY(B29,2)<6)
+(MIN(MOD(D29,1),F3)-MIN(MOD(D29,1),E3))*(WEEKDAY(D29,2)<6)

A very kind daddylonglegs and bob phillips assisted me in giving me the below
formula, it basically counts hours excluding sundays and hours stated in E3
and F3


=IF(ISERROR(SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT("1:"&ROUND((D29-B29)*1440,0))
)

/1440+B29-1/2880)<1),--(ABS(MOD(ROW(INDIRECT("1:"&ROUND((D29-B29)*1440,0)))
/1440+B29-1/2880,1)-(E3+F3)/2)(F3-E3)/2)))/1440," 00 days 00 hours 00


minutes",(SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT("1:"&ROUND((D29-B29)*1440,0)))

/1440+B29-1/2880)<1),--(ABS(MOD(ROW(INDIRECT("1:"&ROUND((D29-B29)*1440,0)))
/1440+B29-1/2880,1)-(E3+F3)/2)(F3-E3)/2)))/1440)

[quoted text clipped - 12 lines]

Theresa


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200603/1