Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default If statement

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
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,440
Default If statement

=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


"robertm600635" wrote in message
...
| 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


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default If statement

No IFs are needed:

=((A1="Hourly")*2080+(A1="Salary")*12)*B1

--
Gary''s Student - gsnu200722
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
If Then Statement Help Joanne Excel Discussion (Misc queries) 2 January 30th 06 08:09 PM
I need help with an "If" Statement Whayne Excel Worksheet Functions 3 July 20th 05 09:25 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"