If statement

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
=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
 
Back
Top