If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Another time calculation issue, thanks for any help!
Hello All,
I was hoping to do this without to much difficulty but not having much luck. I got the round down to the nearest 15 minutes. NOW I would like to round up to the nearest 15 minutes (ie. .25, .5, .75 ONLY), in fifteen minute intervals. Here's some of what I've tried so far... Round(1.2/0.6,0) answer: 2 would like 1.25 Int(1.9*8.0+0.6)/8.0 answer: 1.875 would like 2 -Int(-1.2)/60 answer 1.66 would like 1.25 I store the time in decimal format (I need that for another calculation which works perfectly). Any Ideas? Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II |
#2
|
|||
|
|||
Another time calculation issue, thanks for any help!
Round(1.2/0.6,0) answer: 2 would like 1.25
I haven't looked at the others, but I think you're going to have to explain a bit more about how you're doing things, as this SHOULD be 2, using any math: 1.2/0.6 = 2, so Round(2,0) = 2 Rob |
#3
|
|||
|
|||
Another time calculation issue, thanks for any help!
Robert,
I am trying to round TimeDecimal to the NEXT 15 minute interval. I am not saying the answer is wrong but it's not where I want to go. For billing purposes I want to go the the next quarter hour. 1.2 = 1.25 1.3 = 1.5 1.6 = 1.75 1.8 = 2 -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Round(1.2/0.6,0) answer: 2 would like 1.25 I haven't looked at the others, but I think you're going to have to explain a bit more about how you're doing things, as this SHOULD be 2, using any math: 1.2/0.6 = 2, so Round(2,0) = 2 Rob |
#4
|
|||
|
|||
Another time calculation issue, thanks for any help!
Okay, so how are you looking at your Round example, then?
Should Round(1.2/0.6,0) actually become Round(1.25/0.75,0)? Rob "Gina Whipp" wrote in message ... Robert, I am trying to round TimeDecimal to the NEXT 15 minute interval. I am not saying the answer is wrong but it's not where I want to go. For billing purposes I want to go the the next quarter hour. 1.2 = 1.25 1.3 = 1.5 1.6 = 1.75 1.8 = 2 -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Round(1.2/0.6,0) answer: 2 would like 1.25 I haven't looked at the others, but I think you're going to have to explain a bit more about how you're doing things, as this SHOULD be 2, using any math: 1.2/0.6 = 2, so Round(2,0) = 2 Rob |
#5
|
|||
|
|||
Another time calculation issue, thanks for any help!
On Wed, 22 Aug 2007 21:35:17 -0400, "Robert Morley"
wrote: Okay, so how are you looking at your Round example, then? Should Round(1.2/0.6,0) actually become Round(1.25/0.75,0)? Gina, I take it you're trying to round UP rather than round DOWN? If so, try Round([expression] + 0.2499999, 0) John W. Vinson [MVP] |
#6
|
|||
|
|||
Another time calculation issue, thanks for any help!
I am trying to get to my ultimate goal. In the Round formula the 1.2 is MY
time decimal field, it will not say 1.25 to be /0.75. I am trying to round up and I was only using that as one of the solutions I tried that didn't work. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Okay, so how are you looking at your Round example, then? Should Round(1.2/0.6,0) actually become Round(1.25/0.75,0)? Rob "Gina Whipp" wrote in message ... Robert, I am trying to round TimeDecimal to the NEXT 15 minute interval. I am not saying the answer is wrong but it's not where I want to go. For billing purposes I want to go the the next quarter hour. 1.2 = 1.25 1.3 = 1.5 1.6 = 1.75 1.8 = 2 -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Round(1.2/0.6,0) answer: 2 would like 1.25 I haven't looked at the others, but I think you're going to have to explain a bit more about how you're doing things, as this SHOULD be 2, using any math: 1.2/0.6 = 2, so Round(2,0) = 2 Rob |
#7
|
|||
|
|||
Another time calculation issue, thanks for any help!
Yes, I am.
Your formula gives me 1 and not 1.25. I am now playing with this one and it seems to do what I want: Int(1 + [TimeDecimal] * 4) / 4 EXCEPT if the time decimal is 1.25 or 1.5 or 1.75 it want to round up and I would like it to except those values. I feel and if then else statement coming on.... 1.2 = 1.25 1.6 = 1.75 1.8 = 2 -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "John W. Vinson" wrote in message ... On Wed, 22 Aug 2007 21:35:17 -0400, "Robert Morley" wrote: Okay, so how are you looking at your Round example, then? Should Round(1.2/0.6,0) actually become Round(1.25/0.75,0)? Gina, I take it you're trying to round UP rather than round DOWN? If so, try Round([expression] + 0.2499999, 0) John W. Vinson [MVP] |
#8
|
|||
|
|||
Another time calculation issue, thanks for any help!
Okay, so going back to the previous formula that I gave you, just integrate
it with John's suggestion, and I believe you should get what you're looking for: Int(([aTimeDecimal] + 0.24999999999) * 4) / 4 Or you can make it look a little cleaner by doing the * 4 yourself and then you get: Int([aTimeDecimal] * 4 + 0.99999999999) / 4 Rob "Gina Whipp" wrote in message ... I am trying to get to my ultimate goal. In the Round formula the 1.2 is MY time decimal field, it will not say 1.25 to be /0.75. I am trying to round up and I was only using that as one of the solutions I tried that didn't work. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Okay, so how are you looking at your Round example, then? Should Round(1.2/0.6,0) actually become Round(1.25/0.75,0)? Rob "Gina Whipp" wrote in message ... Robert, I am trying to round TimeDecimal to the NEXT 15 minute interval. I am not saying the answer is wrong but it's not where I want to go. For billing purposes I want to go the the next quarter hour. 1.2 = 1.25 1.3 = 1.5 1.6 = 1.75 1.8 = 2 -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Round(1.2/0.6,0) answer: 2 would like 1.25 I haven't looked at the others, but I think you're going to have to explain a bit more about how you're doing things, as this SHOULD be 2, using any math: 1.2/0.6 = 2, so Round(2,0) = 2 Rob |
#9
|
|||
|
|||
Another time calculation issue, thanks for any help!
Is this what you are looking for?
Public Function RoundUp(Num As Double, Mins As Byte) As Double Dim Remainder As Integer Remainder = Num * 60 Mod Mins If Remainder 0 Then RoundUp = ((Num * 60) + (Mins - Remainder)) / 60 Else RoundUp = Num End If End Function RoundUp(1.2, 15) results in 1.25 and so on... Steve "Gina Whipp" wrote: I am trying to get to my ultimate goal. In the Round formula the 1.2 is MY time decimal field, it will not say 1.25 to be /0.75. I am trying to round up and I was only using that as one of the solutions I tried that didn't work. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Okay, so how are you looking at your Round example, then? Should Round(1.2/0.6,0) actually become Round(1.25/0.75,0)? Rob "Gina Whipp" wrote in message ... Robert, I am trying to round TimeDecimal to the NEXT 15 minute interval. I am not saying the answer is wrong but it's not where I want to go. For billing purposes I want to go the the next quarter hour. 1.2 = 1.25 1.3 = 1.5 1.6 = 1.75 1.8 = 2 -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Round(1.2/0.6,0) answer: 2 would like 1.25 I haven't looked at the others, but I think you're going to have to explain a bit more about how you're doing things, as this SHOULD be 2, using any math: 1.2/0.6 = 2, so Round(2,0) = 2 Rob |
#10
|
|||
|
|||
Another time calculation issue, thanks for any help!
That looks like it works perfectly, playing with it now... Robert you are a
hair saver! Big THANK YOU! -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Okay, so going back to the previous formula that I gave you, just integrate it with John's suggestion, and I believe you should get what you're looking for: Int(([aTimeDecimal] + 0.24999999999) * 4) / 4 Or you can make it look a little cleaner by doing the * 4 yourself and then you get: Int([aTimeDecimal] * 4 + 0.99999999999) / 4 Rob "Gina Whipp" wrote in message ... I am trying to get to my ultimate goal. In the Round formula the 1.2 is MY time decimal field, it will not say 1.25 to be /0.75. I am trying to round up and I was only using that as one of the solutions I tried that didn't work. -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Okay, so how are you looking at your Round example, then? Should Round(1.2/0.6,0) actually become Round(1.25/0.75,0)? Rob "Gina Whipp" wrote in message ... Robert, I am trying to round TimeDecimal to the NEXT 15 minute interval. I am not saying the answer is wrong but it's not where I want to go. For billing purposes I want to go the the next quarter hour. 1.2 = 1.25 1.3 = 1.5 1.6 = 1.75 1.8 = 2 -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Robert Morley" wrote in message ... Round(1.2/0.6,0) answer: 2 would like 1.25 I haven't looked at the others, but I think you're going to have to explain a bit more about how you're doing things, as this SHOULD be 2, using any math: 1.2/0.6 = 2, so Round(2,0) = 2 Rob |
Thread Tools | |
Display Modes | |
|
|