If statement

G

Guest

I'm trying to use "IF" to do a calculation. What I need to do is run one of
two calculations based on the contents of a cell. Example: If A1="Salary"
Sum(B1*12). If A1="Hourly" Sum(B1*2080). A1 is always going to be either
Salary or Hourly and B1 is the rate of Pay. This is to calculate an annual
salary. Please help
 
N

Niek Otten

=IF(A1="Hourly",B1*12,B1*2080)

Or, slightly shorter

=B1*IF(IfA1="Hourly",12,2080)

Note that you don't need SUM

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


| I'm trying to use "IF" to do a calculation. What I need to do is run one of
| two calculations based on the contents of a cell. Example: If A1="Salary"
| Sum(B1*12). If A1="Hourly" Sum(B1*2080). A1 is always going to be either
| Salary or Hourly and B1 is the rate of Pay. This is to calculate an annual
| salary. Please help
 

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

Top