#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default IF Statements

I am trying to write a funciton with several IF statements and it is not
working. This is to test one cell with all the statements. ie. Say we are
using cell A2,

If cell A2 is 48 it would enter a 1, if cell A2 is 49-54 it would enter a 2,
if cell A2 is 55-60 it would enter a 3, or if cell A2 is greater than 60 it
would enter a 5, otherwise it would enter a 0 if it does not meet any of the
above criteria.

I have tried several if statements and can get part of it to work but not
the entire thing. Can you help me write the function?

Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 52
Default IF Statements

Hi Mylnn,

Try this:

=IF(A260,5,IF(A2=55,3,IF(A2=49,2,IF(A2=48,1,0)) ))

You need to start from the largest number.

Judith
--
Hope this helps


"mlynn" wrote:

I am trying to write a funciton with several IF statements and it is not
working. This is to test one cell with all the statements. ie. Say we are
using cell A2,

If cell A2 is 48 it would enter a 1, if cell A2 is 49-54 it would enter a 2,
if cell A2 is 55-60 it would enter a 3, or if cell A2 is greater than 60 it
would enter a 5, otherwise it would enter a 0 if it does not meet any of the
above criteria.

I have tried several if statements and can get part of it to work but not
the entire thing. Can you help me write the function?

Thank you!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default IF Statements

You don't need any IFs:

=(A2=48)*1+(A248)*(A2<55)*2+(A254)*(A2<61)*3+(A2 60)*5

--
Gary''s Student - gsnu200909
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default IF Statements

Hi,

=LOOKUP(A2,{-999999,48,49,55,61},{0,1,2,3,5})


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"mlynn" wrote:

I am trying to write a funciton with several IF statements and it is not
working. This is to test one cell with all the statements. ie. Say we are
using cell A2,

If cell A2 is 48 it would enter a 1, if cell A2 is 49-54 it would enter a 2,
if cell A2 is 55-60 it would enter a 3, or if cell A2 is greater than 60 it
would enter a 5, otherwise it would enter a 0 if it does not meet any of the
above criteria.

I have tried several if statements and can get part of it to work but not
the entire thing. Can you help me write the function?

Thank you!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF Statements

=IF(A2=48,1,IF(AND(A2=49,A2<=54),2,IF(AND(A2=55, A2<=60),3,0)))
--
David Biddulph


"mlynn" wrote in message
...
I am trying to write a funciton with several IF statements and it is not
working. This is to test one cell with all the statements. ie. Say we
are
using cell A2,

If cell A2 is 48 it would enter a 1, if cell A2 is 49-54 it would enter a
2,
if cell A2 is 55-60 it would enter a 3, or if cell A2 is greater than 60
it
would enter a 5, otherwise it would enter a 0 if it does not meet any of
the
above criteria.

I have tried several if statements and can get part of it to work but not
the entire thing. Can you help me write the function?

Thank you!



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF Statements

Sorry, missed a condition
=IF(A2=48,1,IF(AND(A2=49,A2<=54),2,IF(AND(A2=55, A2<=60),3,IF(A260,5,0))))

If you didn't have the ranges from 48 to 49, and from 54 to 55, where you
say you want 0, it would have been simpler.
--
David Biddulph


"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
=IF(A2=48,1,IF(AND(A2=49,A2<=54),2,IF(AND(A2=55, A2<=60),3,0)))
--
David Biddulph


"mlynn" wrote in message
...
I am trying to write a funciton with several IF statements and it is not
working. This is to test one cell with all the statements. ie. Say we
are
using cell A2,

If cell A2 is 48 it would enter a 1, if cell A2 is 49-54 it would enter a
2,
if cell A2 is 55-60 it would enter a 3, or if cell A2 is greater than 60
it
would enter a 5, otherwise it would enter a 0 if it does not meet any of
the
above criteria.

I have tried several if statements and can get part of it to work but not
the entire thing. Can you help me write the function?

Thank you!





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 510
Default IF Statements

Hi

This will do:
=(A2=48)*1+(A248)*1+(A254)*1+(A260)*2


Arvi Laanemets


"Gary''s Student" wrote in message
...
You don't need any IFs:

=(A2=48)*1+(A248)*(A2<55)*2+(A254)*(A2<61)*3+(A2 60)*5

--
Gary''s Student - gsnu200909



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF Statements

That depends on what values you think the OP wants for A2 values such as
48.5 or 54.5. Your guess may well be right, but ...
--
David Biddulph

"Arvi Laanemets" wrote in message
...
Hi

This will do:
=(A2=48)*1+(A248)*1+(A254)*1+(A260)*2


Arvi Laanemets


"Gary''s Student" wrote in
message ...
You don't need any IFs:

=(A2=48)*1+(A248)*(A2<55)*2+(A254)*(A2<61)*3+(A2 60)*5

--
Gary''s Student - gsnu200909





  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default IF Statements

Thank you Judith this solved my problem.

"JudithJubilee" wrote:

Hi Mylnn,

Try this:

=IF(A260,5,IF(A2=55,3,IF(A2=49,2,IF(A2=48,1,0)) ))

You need to start from the largest number.

Judith
--
Hope this helps


"mlynn" wrote:

I am trying to write a funciton with several IF statements and it is not
working. This is to test one cell with all the statements. ie. Say we are
using cell A2,

If cell A2 is 48 it would enter a 1, if cell A2 is 49-54 it would enter a 2,
if cell A2 is 55-60 it would enter a 3, or if cell A2 is greater than 60 it
would enter a 5, otherwise it would enter a 0 if it does not meet any of the
above criteria.

I have tried several if statements and can get part of it to work but not
the entire thing. Can you help me write the function?

Thank you!

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
SUM and IF statements Bob Excel Worksheet Functions 5 October 29th 06 06:18 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
More than 7 IF statements Atticus Excel Discussion (Misc queries) 2 June 19th 06 03:32 PM
if and or statements Debbie via OfficeKB.com Excel Discussion (Misc queries) 4 June 13th 06 02:24 PM
IF & AND statements hip Excel Worksheet Functions 5 June 7th 06 11:36 PM


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