Forum Discussion
Calculate Duration Up Until A Specific Interval
- Mar 04, 2022
mathetes I think the 'complexity' comes in because of the range chosen. So I believe kheldar wants to sum all the time on 'Moderation' UP TO the end of the selected range.
Some of the issues I see here include:
original formula was looking at [Name] when it should have been looking at [Email]
the range drop down is very hard to work with. why not just use an end time that is either actual time format or at least is text that can be easily converted (as opposed to TIMEVALUE(RIGHT([dropdown],5))
as for how to calculate I think you need to create a conditional duration:
=sumproduct( (check name)*(check activity)*
if( [end time]<=[drop down],
[duration],
if ( [start time]<[drop down],
[drop down] - [start time],
0
)
)
)
assuming you have Excel 365 I did it using LET() so=LET(dTime,INT(MIN(RawMMP[End Time]))+TIMEVALUE(RIGHT($V$6,5)), SUMPRODUCT((RawMMP[Email]="Random Employee 1")*(RawMMP[Status]="Moderation Task")* (IF( RawMMP[End Time]<=dTime, RawMMP[Duration], IF( RawMMP[Start Time] < dTime, dTime - RawMMP[Start Time], 0) ))))
mathetes I think the 'complexity' comes in because of the range chosen. So I believe kheldar wants to sum all the time on 'Moderation' UP TO the end of the selected range.
Some of the issues I see here include:
original formula was looking at [Name] when it should have been looking at [Email]
the range drop down is very hard to work with. why not just use an end time that is either actual time format or at least is text that can be easily converted (as opposed to TIMEVALUE(RIGHT([dropdown],5))
as for how to calculate I think you need to create a conditional duration:
=sumproduct( (check name)*(check activity)*
if( [end time]<=[drop down],
[duration],
if ( [start time]<[drop down],
[drop down] - [start time],
0
)
)
)
assuming you have Excel 365 I did it using LET() so
=LET(dTime,INT(MIN(RawMMP[End Time]))+TIMEVALUE(RIGHT($V$6,5)),
SUMPRODUCT((RawMMP[Email]="Random Employee 1")*(RawMMP[Status]="Moderation Task")*
(IF( RawMMP[End Time]<=dTime,
RawMMP[Duration],
IF( RawMMP[Start Time] < dTime,
dTime - RawMMP[Start Time], 0)
))))
You wrote: So I believe @kheldar wants to sum....
You're probably right, Matt. One of the difficulties providing help here on this site is the necessity, so often, to make assumptions. It's so much easier if we could have face-to-face conversations, not rely on exchange of text messages.
Anyway, I hope your LET function does it.
- mtarlerMar 04, 2022Silver Contributorso true. so true.