#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
WebLord
 
Posts: n/a
Default IF Function

I just need a refresher on how the IF function works with 3 variables.
This is for calculating bonuses based on how many years of seniority an
employee has. Example is:

1-5 years $4000 bonus
6-15 years $ 6000 bonus
15+ $10000 bonus

All I can remember is by uising the IF Function, I can type
=IF(E8=1,B42) where E8 is the reference to the year and B42 is an
absolute reference to $4000, but that is only comparing years greater
or equal to 1. How do I create a way to compare the 3 numbers? I am
kinda remembering a nested IF function, but can't recall how to set it
up, is there a formula table in excel for this type of thing?

Hope this makes sense! Thanks for your time...

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default IF Function


=IF(A1<=5,I1,IF(A1<=15,I2,IF(A115,I3,0)))

Where A1 is the number of years and I1:I3 is the values
(4000,6000,10000).

Regards,
Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=525373

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
WebLord
 
Posts: n/a
Default IF Function

Thanks for the reply and your help!

Just another quick question though...:)

When I input .5 for the years (or anything less than a year), I still
get a bonus of $4000? Is the 0 at the end of the formula meant for
anything other than these variables, value is 0?

Thanks again...

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default IF Function


I wasn't sure if anything under 1 yr would be 0 so modify the original
formula slightly.

=IF(A1<1,0,IF(A1<=5,I1,IF(A1<=15,I2,IF(A115,I3,0) )))

The zero at the end is if none of these conditions are met. Broken out
it is:

IF(A1<0 then return 0, if not then

IF(A1<=5 then return value in I1, if not then

IF(A1<=15 then return calue in I2, if not then

IF(A115 then return the value in I3,

if none of the conditions are met then return zero

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=525373

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default IF Function


I wasn't sure if anything under 1 yr would be 0 so modify the original
formula slightly.

=IF(A1<1,0,IF(A1<=5,I1,IF(A1<=15,I2,IF(A115,I3,0) )))

The zero at the end is if none of these conditions are met. Broken out
it is:

IF(A1<0 then return 0, if not then

IF(A1<=5 then return value in I1, if not then

IF(A1<=15 then return calue in I2, if not then

IF(A115 then return the value in I3,

if none of the conditions are met then return zero

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=525373



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
WebLord
 
Posts: n/a
Default IF Function

Thank you Steve, you have been very helpful and I appreciate it
greatly!

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
Creating a Custom Excel Function to Calculate Gini Coefficients [email protected] Excel Worksheet Functions 3 February 21st 06 10:15 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Hyperlinks using R[1]C[1] and offset function in its cell referenc Elijah-Dadda Excel Worksheet Functions 0 March 5th 05 03:31 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 02:03 AM.

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

About Us

"It's about Microsoft Excel"