name a formula

daveturner80

New Member
Joined
May 11, 2011
Messages
18
In our fire company we give out service pins for every 5 years of service.
I know that I can only have 7 nested formulas.
I am using the following formulas, but would like to use them as names.
=if(r3=5,5,if(r3=10,10,if(r3=15,15,if(r3=20,20,if(r3=25,25,if(r3=30,30,if(r3=35,35)))))))
=if(r3=40,40,if(r3=50,50,if(r3=55,55,if(r3=60,60,if(r3=65,65))))
<table border="0" cellpadding="0" cellspacing="0" width="80"><col width="80"><tr height="21"> <td class="xl65" style="height:15.75pt;width:60pt" height="21" width="80"> </td> </tr></table>Is there anyway I could name the top formula something like five to 35 and the second one forty to 65, and use this formula?
=if(fiveto35,fiveto35,fortyto65)
I thought I read somewhere that this could be done, or there easier formula that could be used?
Thanks for any help you can provide.
Dave
<table style="width: 80px; height: 1px;" border="0" cellpadding="0" cellspacing="0"><col width="80"><tr height="21"> <td class="xl63" style="height:15.75pt;width:60pt" height="21" width="80"> <table border="0" cellpadding="0" cellspacing="0" width="80"><col width="80"><tr height="21"> <td class="xl65" style="height:15.75pt;width:60pt" height="21" width="80">
</td> </tr></table></td> </tr></table>
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Dave,

Try the following formula, it will give you the following:

service 5 - 9 years = 5
service 10 - 14 years = 10
service 15 - 19 years = 15
etc

=LOOKUP(R3,{5,10,15,20,25,30,35,40,45,50,55,60,65},{5,10,15,20,25,30,35,40,45,50,55,60,65})

HTH
Ian
 
Upvote 0
your lookup formula is working, however every cell that is less than 5 it is putting #N/A in the cell. How would I get these out of the cells.
Thanks for your quick response.
Dave
 
Upvote 0
Does either of these formulas work for you?:
Code:
=IF(R3=CEILING(R3,5),R3,"")
or
Code:
=CEILING(R3,5)
 
Upvote 0
Hi,

Add an if statement on the front of it.....

=if(R3>4,LOOKUP(R3,{5,10,15,20,25,30,35,40,45,50,55,60,65},{5,10,15,20,25,30,35,40,45,50,55,60,65}),"Less Than 5 Years")

Ammend the formula text "less than 5 Years" as required - if you don't want anything in the cell just leave it as ""

Cheers,
Ian
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,839
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top