Thanks! It work!
Do you have any interest in explaining how this works? I'm very interested.
=0.1*INT( (5+ (MOD(B2-B1,6)=0) + TEXT(B2-B1,"[m]") ) /6 )
First off, as I am sure you guessed, this...
TEXT(B2-B1,"[m]")
returns the number of minutes (the square brackets around the "m" allows the function to return a value greater than 60 if the number of minutes exceeds 60). Next, in order to get the range of values you want, we have to add 6 to this value (in anticipation
of a later calculation) which is what my original formula did; however, because you did not want the boundary points (6, 12, etc.) to bump up to the next interval, we have to subtract 1 from the 6 whenever the number of minutes is a boundary point... I do
that with a logical expression, namely, this one...
MOD(B2-B1,6)=0
Logical expressions evaluate to either TRUE or FALSE and, when involved in a mathematical expression, these get converted to 1 or 0 respectively. The MOD function above will return TRUE if B2-B1 is a multiple of 6 and FALSE otherwise. Multiples of 6 are
your boundary points that you do not want bumped up. So, that constant value 5 will become a 6 whenever the number of minutes is NOT a multiple of 6 and remain 5 when it is. Next, we divide by 6 and apply the INT function inorder to reduce the calculated values
to the numbers 1, 2, 3, etc. Note that the division by 6 is the reason we had to adjust the original constant 6 to a 5 when the number of minutes is a boundary point... boundary points divided by 6 are whole numbers which are one greater than the whole number
parts of the values before the boundary points... the INT function chops off the decimal part and leaves the whole number... the whole number for boundary points is one greater than the whole number for values immediately prior to it... this meant
that without making the above described adjustment, boundary points would be in the next interval from the values immediately before them (and you said you did not want that). Finally, the multiplication by 0.1 just adjusts the calculated values of 1, 2, 3,
etc. to the range you wanted, namely, 0.1, 0.2, 0.3, etc.
NOTE: Please mark the message or messages (yes, you can mark more than one) that answer your question as the "Answer" so that others will know your question has been resolved.