Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
dealn2
 
Posts: n/a
Default How do I replace a negative number at the end of a formula with a.

I have a formula in excel that calculates overtime hours for my employees.
Hours are deducted from overtime for personal time and comp time. If the
personal and comp time hours are more than the overtime hours it gives me a
negative number and then because it is a negative number it adds hours to the
regular hours pay. I need to have the formula treat a negative number like a
zero or equal a zero and not a negative amount. Here is the formula I use.
=IF(G45<212,0,G45-212)*1-(E67+C67+E51)
Thanks for any help you can give.

  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

=MAX(0,G45-212)-MAX(0,E67+C67+E51)


In article ,
dealn2 wrote:

I have a formula in excel that calculates overtime hours for my employees.
Hours are deducted from overtime for personal time and comp time. If the
personal and comp time hours are more than the overtime hours it gives me a
negative number and then because it is a negative number it adds hours to the
regular hours pay. I need to have the formula treat a negative number like a
zero or equal a zero and not a negative amount. Here is the formula I use.
=IF(G45<212,0,G45-212)*1-(E67+C67+E51)
Thanks for any help you can give.

  #4   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

Use MAX

=MAX(0,your_formula_that_can_produce_negative_numb ers)

anytime the formula would return less than zero the result will be zero
since MAX will retrun the larger number

Regards,

Peo Sjoblom

"dealn2" wrote:

I have a formula in excel that calculates overtime hours for my employees.
Hours are deducted from overtime for personal time and comp time. If the
personal and comp time hours are more than the overtime hours it gives me a
negative number and then because it is a negative number it adds hours to the
regular hours pay. I need to have the formula treat a negative number like a
zero or equal a zero and not a negative amount. Here is the formula I use.
=IF(G45<212,0,G45-212)*1-(E67+C67+E51)
Thanks for any help you can give.

  #6   Report Post  
dealn2
 
Posts: n/a
Default

Thanks for the help. I could not use the example you gave but I was able to
figure it out from your response.

"Peo Sjoblom" wrote:

Use MAX

=MAX(0,your_formula_that_can_produce_negative_numb ers)

anytime the formula would return less than zero the result will be zero
since MAX will retrun the larger number

Regards,

Peo Sjoblom

"dealn2" wrote:

I have a formula in excel that calculates overtime hours for my employees.
Hours are deducted from overtime for personal time and comp time. If the
personal and comp time hours are more than the overtime hours it gives me a
negative number and then because it is a negative number it adds hours to the
regular hours pay. I need to have the formula treat a negative number like a
zero or equal a zero and not a negative amount. Here is the formula I use.
=IF(G45<212,0,G45-212)*1-(E67+C67+E51)
Thanks for any help you can give.

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
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
Formatting in the formula bar Beccy Excel Discussion (Misc queries) 2 December 22nd 04 02:41 PM
How to format a number in Indian style in Excel? Victor_alb Excel Discussion (Misc queries) 2 December 21st 04 04:21 AM
Count number of shaded cells Maddoktor Excel Discussion (Misc queries) 2 December 20th 04 08:35 PM
how to change the state of a number in a cell from negative to po. Steve11 Excel Discussion (Misc queries) 1 November 29th 04 07:00 AM


All times are GMT +1. The time now is 05:38 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"