If/Then in a Function?

K

kelemvor

I have a column of numbers and I need to multiply them by one of two se
values. Basically the first 10 get multiplied by X and anything ove
10 gets multiplied by Y.

Think of it like paying someone overtime. Up to 40 hours you get pai
one amount and every hour over 40 you get paid a different amount.

Can I do this in one statement somehow?

Basically it's If B2+B3 <10 then B7 = (B2+B3)*25
If B2+B3 > 10 then B7 = (B2+B3-10)*10 + 250

How can I do that in Excel
 
J

JulieD

Hi

=IF(B2+B3<=10,(B2+B3)*25),(B2+B3)-10*10+250)
in B7 should give you what you want (notice i put <= in the test as that's
how i under stood your written question)

Cheers
JulieD
 
K

kelemvor

So the first comma separates the If from the Then and the second one i
the Then from the Else. Didn't know that's how it worked.

Looks good.

Thank
 
J

JulieD

Yes,

the basic syntax is =IF(test, true, false)
in which you can then nest other IF statements
e.g.
=IF(test,IF(test,true,false),IF(test,true,false))
etc

Regards
JulieD
 
Top