Thread: Formula Help
View Single Post
 
Old 12-26-2013, 09:32 PM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Let me break that formula down and see what it's doing. Let's say h is the number of hours worked and r the hourly rate; in that case your formula says
Code:
if {h > 40} and {h <= 1.5(h-40) + 40r}
  then D8=hr
Excel doesn't know what you want to do, only what you tell, of course; and it it won't accept this formula because you need also tell it what value to use if the condition is false. But forget about fixing that part of it; it seems to me that you need to start over. You want D8 to be something like this:
Code:
  (the part of h <= 40) *  r
+ (the part of h >  40) * (r * 1.5)
Or even simpler:
Code:
[h + (the part of h > 40)*0.5] * r
"The part of h > 40" could be written as just h-40, but if h < 40 that yields a negative number. You want MAX(h-40,0); that picks the larger of the two numbers, h-40 and 0, so that if h > 40 then you get h-40 but otherwise you get 0. So in D8 you put
Code:
=(D5+MAX(D5-40,0)/2)*D3
Reply With Quote