Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default More Formula Help....

Thanks to Bob Phillips for the following formul

=SUMPRODUCT((C$1=TIME(ROW(C6)-6,0,0))*(C$1<TIME(ROW(C6)-5,0,0)))*C$

it is not working quite right yet

This is what I hav
Start C1=00:00 (entered
Stop C2=5:00 (entered
Duration C2-C1 (Calculated
Items per Hour C4 (Entered
Total Production Production Total C
B6:B29 1-24 (Hours in day
C6:C29 formula=SUMPRODUCT((C$1=TIME(ROW(C6)-6,0,0))*(C$1<TIME(ROW(C6)-5,0,0)))*C$4 (Copied down the column

I would expect there to be 100 in C6:C10 but Im only getting it in C6. Also if start time is anything but even hour, it still gives full production for the hour. Any ideas suggestions

Thanks again!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default More Formula Help....

This formula does what you describe: (adjusted for revelation that hours are
in column B - assumes hours are stored as times (ex: 1:00) and not as
integers (ex: 1)
Place this in C6 and drag fill down.
=MAX(0,((MIN(B6+TIMEVALUE("01:00"),$C$2)-MAX(B6,$C$1))*24/$C$3)*$C$5)

I guess if you only want to work with Bob, then you can ignore it again.

--
Regards,
Tom Ogilvy


"Jan" wrote in message
...
Thanks to Bob Phillips for the following formula

=SUMPRODUCT((C$1=TIME(ROW(C6)-6,0,0))*(C$1<TIME(ROW(C6)-5,0,0)))*C$4

it is not working quite right yet.

This is what I have
Start C1=00:00 (entered)
Stop C2=5:00 (entered)
Duration C2-C1 (Calculated)
Items per Hour C4 (Entered)
Total Production Production Total C5
B6:B29 1-24 (Hours in day)
C6:C29

formula=SUMPRODUCT((C$1=TIME(ROW(C6)-6,0,0))*(C$1<TIME(ROW(C6)-5,0,0)))*C$4
(Copied down the column)

I would expect there to be 100 in C6:C10 but Im only getting it in C6.

Also if start time is anything but even hour, it still gives full production
for the hour. Any ideas suggestions?

Thanks again!





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default More Formula Help....

Indeed.

Perhaps Jan, you are not receiving all of the posts?

The formula which I recommended works fine, with a little modification. The
original formula is in the "Hours affected by Dates" page of my website.

Here's the modification that fits your problem.
Just put 00:00 in D6, =D6+1/24 in D7
This formula (no spaces) goes in C6.
=IF(OR(AND(C$1<=C$2,C$2<=D6),AND(C$1=E6,OR(C$1<=C $2,C$2<=D6))),0,IF(AND(C$2
<=E6,C$2=D6,OR(C$1<=D6,C$1=E6)),C$2-D6,IF(OR(AND(C$1<=D6,C$2=E6),AND(C$1
=C$2,OR(C$1<=D6,C$2=E6))),E6-D6,IF(AND(C$1<=C$2,C$1=D6,C$2<=E6),C$2-C$1,IF
(AND(C$1=D6,C$1<=E6,OR(C$2<=D6,C$2=E6)),E6-C$1,(C$2-D6)+(E6-C$1))))))

Then fill down the formula.

It's overkill (because it handles ranges over midnight), but should do what
you're after.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Tom Ogilvy" wrote in message
...
This formula does what you describe: (adjusted for revelation that hours

are
in column B - assumes hours are stored as times (ex: 1:00) and not as
integers (ex: 1)
Place this in C6 and drag fill down.
=MAX(0,((MIN(B6+TIMEVALUE("01:00"),$C$2)-MAX(B6,$C$1))*24/$C$3)*$C$5)

I guess if you only want to work with Bob, then you can ignore it again.

--
Regards,
Tom Ogilvy


"Jan" wrote in message
...
Thanks to Bob Phillips for the following formula

=SUMPRODUCT((C$1=TIME(ROW(C6)-6,0,0))*(C$1<TIME(ROW(C6)-5,0,0)))*C$4

it is not working quite right yet.

This is what I have
Start C1=00:00 (entered)
Stop C2=5:00 (entered)
Duration C2-C1 (Calculated)
Items per Hour C4 (Entered)
Total Production Production Total C5
B6:B29 1-24 (Hours in day)
C6:C29


formula=SUMPRODUCT((C$1=TIME(ROW(C6)-6,0,0))*(C$1<TIME(ROW(C6)-5,0,0)))*C$4
(Copied down the column)

I would expect there to be 100 in C6:C10 but Im only getting it in C6.

Also if start time is anything but even hour, it still gives full

production
for the hour. Any ideas suggestions?

Thanks again!







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"