View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AKphidelt AKphidelt is offline
external usenet poster
 
Posts: 461
Default Vlookup or IF statement

This is kind of a small work around but you can use this formula to get the
results that you want based off 5 years

=IF((A1/5)<1,"1 - 5 years",INT(A1/5)*5+1&" - "&INT(A1/5)*5+5)

"GuinnessT" wrote:

Hi,

I want to assign a group to each of my data columns

eg I have employees years of service and I want to add a group such as 1-5
years 6-10 years etc

Name Years of Service Group
J Blogs 2.5 1 - 5 years
S Smith 11 11-15 years

The only way I can think of doing it is by using IF statments to say if the
value is between 1 and 5 put '1-5 years' etc but this would need more than 7
nested IF's and I have been told that if you need more than 7 there is a
better way of doing it!

Could a vlookup work and if so, how do you get it to look at values within a
range?

Thanks