View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs daddylonglegs is offline
external usenet poster
 
Posts: 287
Default Time difference w/o weekends

Hello AG,

Let's see if I understand your requirements....

On Tuesdays, Wednesdays and Thursday you want to count all 24 hours? so if
start time and date was now [Saturday 24th May 14:00] and end time and date
was the same time next week then the result would be 105?

If so then, assuming start time and date in A2 and end time and date in B2
try this formula:

=SUMPRODUCT(--(WEEKDAY((ROW(INDIRECT("1:"&ROUND((B2-A2)*1440,0)))-0.5)/1440+A2-3/8,2)+MOD((ROW(INDIRECT("1:"&ROUND((B2-A2)*1440,0)))-0.5)/1440+A2-3/8,1)<43/8))/60

Format result cell as number

Note: this works for time periods up to approx 45 days



"AG" wrote:

Hi Bob,
Thanks for your help. I tried the formula. It works but it gives the
wrong results. Let me know if I should provide with more details with
numbers?
Regards,
-AG