Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Help! IF functions

Hello,

I have a list of ages (all to 2 decimal places) and i am trying to use an if
function to classify them into groups. Next to the list of ages i would like
another column indicating which group the individual falls in. Group
membership should follow the rules below:

age < 8 = group 1
age 9-11 = group 2
age 12-14 = group3
age 15+ = group 4

The formula i have put in is pasted below but it doesn't work, does anyone
know what might be wrong with it? I have used decimal numbers (e.g.11.99) for
the end of ranges as otherwise some ages will fall into more than one group:

=IF(A1=<8, "1", IF(A1=9:11.99, "2", IF(A1=12:14.99, "3", IF(A1=15, "4",
"0"))))

Any ideas? I have been tring for ages to see what's wrong but can't come up
with anything!




--
Anna
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Help! IF functions

=LOOKUP(A1,{0,"GROUP 1";9,"GROUP 2";12,"GROUP 3";15,"GROUP 4"})
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"Anna57" wrote:

Hello,

I have a list of ages (all to 2 decimal places) and i am trying to use an if
function to classify them into groups. Next to the list of ages i would like
another column indicating which group the individual falls in. Group
membership should follow the rules below:

age < 8 = group 1
age 9-11 = group 2
age 12-14 = group3
age 15+ = group 4

The formula i have put in is pasted below but it doesn't work, does anyone
know what might be wrong with it? I have used decimal numbers (e.g.11.99) for
the end of ranges as otherwise some ages will fall into more than one group:

=IF(A1=<8, "1", IF(A1=9:11.99, "2", IF(A1=12:14.99, "3", IF(A1=15, "4",
"0"))))

Any ideas? I have been tring for ages to see what's wrong but can't come up
with anything!




--
Anna

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Help! IF functions

Hi,

Try this

=IF(A1<=8,1,IF(A1<=11,2,IF(A1<=14,3,4)))

Mike.

"Anna57" wrote:

Hello,

I have a list of ages (all to 2 decimal places) and i am trying to use an if
function to classify them into groups. Next to the list of ages i would like
another column indicating which group the individual falls in. Group
membership should follow the rules below:

age < 8 = group 1
age 9-11 = group 2
age 12-14 = group3
age 15+ = group 4

The formula i have put in is pasted below but it doesn't work, does anyone
know what might be wrong with it? I have used decimal numbers (e.g.11.99) for
the end of ranges as otherwise some ages will fall into more than one group:

=IF(A1=<8, "1", IF(A1=9:11.99, "2", IF(A1=12:14.99, "3", IF(A1=15, "4",
"0"))))

Any ideas? I have been tring for ages to see what's wrong but can't come up
with anything!




--
Anna

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Help! IF functions

You have left out some ranges.

What about 8 to 8.99?

Try this lookup formula. Adjust to suit.

=LOOKUP(B1,{0,8,12,15,15.01},{1,2,3,4,4})


Gord Dibben MS Excel MVP

On Tue, 4 Nov 2008 07:10:05 -0800, Anna57
wrote:

Hello,

I have a list of ages (all to 2 decimal places) and i am trying to use an if
function to classify them into groups. Next to the list of ages i would like
another column indicating which group the individual falls in. Group
membership should follow the rules below:

age < 8 = group 1
age 9-11 = group 2
age 12-14 = group3
age 15+ = group 4

The formula i have put in is pasted below but it doesn't work, does anyone
know what might be wrong with it? I have used decimal numbers (e.g.11.99) for
the end of ranges as otherwise some ages will fall into more than one group:

=IF(A1=<8, "1", IF(A1=9:11.99, "2", IF(A1=12:14.99, "3", IF(A1=15, "4",
"0"))))

Any ideas? I have been tring for ages to see what's wrong but can't come up
with anything!


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
How to convert cell formula functions to code functions Adnan Excel Discussion (Misc queries) 1 October 1st 08 08:30 PM
formula/functions for average and if functions Petu71 Excel Worksheet Functions 2 August 5th 07 08:25 PM
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
Looking for a site with functions that substitute the ATP functions Franz Verga Excel Worksheet Functions 3 June 24th 06 04:30 AM
Nesting functions in the functions dialog box cs170a Excel Worksheet Functions 0 June 10th 05 10:36 PM


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