If/Then in a Function?

  • Thread starter Thread starter kelemvor
  • Start date Start date
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
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top