LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Vlookup or IF statement

Thanks Akphidelt, great solution works great

Jenny

"akphidelt" wrote:

Alright, sorry about this, but I felt a little bad about the code and
actually tried it out. It does work except if a value is 15, it will select
16-20 years. So to correct that, use this equation instead and you should be
good

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

"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

 
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
if then statement (i think) or vlookup Ann Excel Worksheet Functions 1 June 6th 08 12:51 AM
using vlookup within an if statement Sweetetc Excel Worksheet Functions 7 December 6th 06 05:54 PM
Vlookup with if statement Trishames Excel Discussion (Misc queries) 1 December 1st 06 03:54 AM
Vlookup with if statement Dave F Excel Discussion (Misc queries) 0 November 30th 06 05:56 PM
VLOOKUP with IF statement Kay Excel Discussion (Misc queries) 4 August 18th 05 02:51 AM


All times are GMT +1. The time now is 08:58 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"