Hi,
In the attached WB - the formula, in Col. "D", seems to be too long - although returning the expected result.
Could somebody lighten my eyes with a much shorter formula ?
Thanks, Elm
Hi,
In the attached WB - the formula, in Col. "D", seems to be too long - although returning the expected result.
Could somebody lighten my eyes with a much shorter formula ?
Thanks, Elm
Last edited by ElmerS; 02-20-2010 at 10:28 AM.
doesnt look to long to me!
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and now happily retired
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
Depending on the type of shift you might have I think your current formula might miscalculate in some circumstances, e.g. if it's possible to have a shift 06:00 to 22:00 then presumably that should be 2:00 of nights (the first hour and the last hour) but your formula returns 1:00
I normally calculate the day hours with a longer formula so I'd use this formula in C2 copied down to calculate those
=(A2>B2)*MEDIAN(0,B2-J$3,J$2-J$3)+MAX(0,MIN(J$2,B2+(A2>B2))-MAX(J$3,A2))
and then just get the rest in D2 with
=E2-C2
Woooooooowww...
This is what I've been waiting for.
Saving 37% of a formulas length simplifies it for the average user.
Thank you so much, Elm
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks