Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
PaRtaP
 
Posts: n/a
Default How do I set a rule to add a number, but only if it is positive?

I am trying to add hours together using Excel, the problem is if the hours
are greater than 40 then I have to subtract 40 hours and add the remaining
number to the O.T Hours. How do I set a rule to add a number, but only if it
is positive?
For example 43.56 hours - 40.00 = 3.56 hours add to O.T. hrs which = O.T. +
3.56 this is okay because the first number is greater than 40.00 so the
result is positive but what if it was 36.42 - 40.00 = -3.56 add to O.T. hrs
which = O.T. - 3.56 this is not what I want because I don't want to subtract
hours I only want to add the hours if positive.
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default How do I set a rule to add a number, but only if it is positive?

One way

=MAX(0,C2-40)

where C2 holds 3.56

--
Regards,

Peo Sjoblom

(No private emails please)


"PaRtaP" wrote in message
...
I am trying to add hours together using Excel, the problem is if the hours
are greater than 40 then I have to subtract 40 hours and add the remaining
number to the O.T Hours. How do I set a rule to add a number, but only if
it
is positive?
For example 43.56 hours - 40.00 = 3.56 hours add to O.T. hrs which = O.T.
+
3.56 this is okay because the first number is greater than 40.00 so the
result is positive but what if it was 36.42 - 40.00 = -3.56 add to O.T.
hrs
which = O.T. - 3.56 this is not what I want because I don't want to
subtract
hours I only want to add the hours if positive.


  #3   Report Post  
Barb Reinhardt
 
Posts: n/a
Default How do I set a rule to add a number, but only if it is positive?

Have you tried using the MOD function.

=MOD(A1,40)

I'm not exactly clear on what you want, so please come back and let us know
what else you might want.




"PaRtaP" wrote in message
...
I am trying to add hours together using Excel, the problem is if the hours
are greater than 40 then I have to subtract 40 hours and add the remaining
number to the O.T Hours. How do I set a rule to add a number, but only if
it
is positive?
For example 43.56 hours - 40.00 = 3.56 hours add to O.T. hrs which = O.T.
+
3.56 this is okay because the first number is greater than 40.00 so the
result is positive but what if it was 36.42 - 40.00 = -3.56 add to O.T.
hrs
which = O.T. - 3.56 this is not what I want because I don't want to
subtract
hours I only want to add the hours if positive.



  #4   Report Post  
Peo Sjoblom
 
Posts: n/a
Default How do I set a rule to add a number, but only if it is positive?

That will return for instance 37 if the hours worked is 37
when it should return zero

--
Regards,

Peo Sjoblom

(No private emails please)


"Barb Reinhardt" wrote in message
...
Have you tried using the MOD function.

=MOD(A1,40)

I'm not exactly clear on what you want, so please come back and let us
know what else you might want.




"PaRtaP" wrote in message
...
I am trying to add hours together using Excel, the problem is if the hours
are greater than 40 then I have to subtract 40 hours and add the
remaining
number to the O.T Hours. How do I set a rule to add a number, but only if
it
is positive?
For example 43.56 hours - 40.00 = 3.56 hours add to O.T. hrs which = O.T.
+
3.56 this is okay because the first number is greater than 40.00 so the
result is positive but what if it was 36.42 - 40.00 = -3.56 add to O.T.
hrs
which = O.T. - 3.56 this is not what I want because I don't want to
subtract
hours I only want to add the hours if positive.




  #5   Report Post  
PaRtaP
 
Posts: n/a
Default How do I set a rule to add a number, but only if it is positiv

Thank you for your help!!!! You guys solved one of my big problems trying to
orgnize hours for employees, I wasn't sure if I was clear when posting, but
Peo Sjoblom your way worked perfectly, I haven't tried the MOD way but I
will, once again thank you both for ur help.

"Barb Reinhardt" wrote:

Have you tried using the MOD function.

=MOD(A1,40)

I'm not exactly clear on what you want, so please come back and let us know
what else you might want.




"PaRtaP" wrote in message
...
I am trying to add hours together using Excel, the problem is if the hours
are greater than 40 then I have to subtract 40 hours and add the remaining
number to the O.T Hours. How do I set a rule to add a number, but only if
it
is positive?
For example 43.56 hours - 40.00 = 3.56 hours add to O.T. hrs which = O.T.
+
3.56 this is okay because the first number is greater than 40.00 so the
result is positive but what if it was 36.42 - 40.00 = -3.56 add to O.T.
hrs
which = O.T. - 3.56 this is not what I want because I don't want to
subtract
hours I only want to add the hours if positive.






  #6   Report Post  
Peo Sjoblom
 
Posts: n/a
Default How do I set a rule to add a number, but only if it is positiv

I had a typo but I assume you figured that out, C2 would obviously hold
43.56 not 3.56

--
Regards,

Peo Sjoblom

(No private emails please)


"PaRtaP" wrote in message
...
Thank you for your help!!!! You guys solved one of my big problems trying
to
orgnize hours for employees, I wasn't sure if I was clear when posting,
but
Peo Sjoblom your way worked perfectly, I haven't tried the MOD way but I
will, once again thank you both for ur help.

"Barb Reinhardt" wrote:

Have you tried using the MOD function.

=MOD(A1,40)

I'm not exactly clear on what you want, so please come back and let us
know
what else you might want.




"PaRtaP" wrote in message
...
I am trying to add hours together using Excel, the problem is if the
hours
are greater than 40 then I have to subtract 40 hours and add the
remaining
number to the O.T Hours. How do I set a rule to add a number, but only
if
it
is positive?
For example 43.56 hours - 40.00 = 3.56 hours add to O.T. hrs which =
O.T.
+
3.56 this is okay because the first number is greater than 40.00 so the
result is positive but what if it was 36.42 - 40.00 = -3.56 add to O.T.
hrs
which = O.T. - 3.56 this is not what I want because I don't want to
subtract
hours I only want to add the hours if positive.





  #7   Report Post  
PaRtaP
 
Posts: n/a
Default How do I set a rule to add a number, but only if it is positiv

Yea, I figured thanx again it would take me forever to do by hand now I have
a template made.

"Peo Sjoblom" wrote:

I had a typo but I assume you figured that out, C2 would obviously hold
43.56 not 3.56

--
Regards,

Peo Sjoblom

(No private emails please)


"PaRtaP" wrote in message
...
Thank you for your help!!!! You guys solved one of my big problems trying
to
orgnize hours for employees, I wasn't sure if I was clear when posting,
but
Peo Sjoblom your way worked perfectly, I haven't tried the MOD way but I
will, once again thank you both for ur help.

"Barb Reinhardt" wrote:

Have you tried using the MOD function.

=MOD(A1,40)

I'm not exactly clear on what you want, so please come back and let us
know
what else you might want.




"PaRtaP" wrote in message
...
I am trying to add hours together using Excel, the problem is if the
hours
are greater than 40 then I have to subtract 40 hours and add the
remaining
number to the O.T Hours. How do I set a rule to add a number, but only
if
it
is positive?
For example 43.56 hours - 40.00 = 3.56 hours add to O.T. hrs which =
O.T.
+
3.56 this is okay because the first number is greater than 40.00 so the
result is positive but what if it was 36.42 - 40.00 = -3.56 add to O.T.
hrs
which = O.T. - 3.56 this is not what I want because I don't want to
subtract
hours I only want to add the hours if positive.





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
Preceding a number by zeros, that is still a number Michele Excel Worksheet Functions 1 September 14th 05 01:06 PM
Count Number of Characters in a cell? AHJuncti Excel Discussion (Misc queries) 2 June 16th 05 07:39 PM
Need number of Saturdays and number of Sundays between 2 dates Class316 Excel Worksheet Functions 1 June 10th 05 02:47 AM
get lowest positive number Tommy Excel Discussion (Misc queries) 12 May 17th 05 05:28 PM
how do you get a positive number payment with a mortgage payment . sam Excel Worksheet Functions 1 February 2nd 05 05:32 AM


All times are GMT +1. The time now is 10:17 PM.

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

About Us

"It's about Microsoft Excel"