Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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! |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF Statements
Using IF, modify to suit. Start at the top
=IF(D620,3,IF(D610,2,IF(D60,1,""))) -- Don Guillett Microsoft MVP Excel SalesAid Software "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! |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SUM and IF statements | Excel Worksheet Functions | |||
IF Statements (Mutliple Statements) | Excel Worksheet Functions | |||
More than 7 IF statements | Excel Discussion (Misc queries) | |||
if and or statements | Excel Discussion (Misc queries) | |||
IF & AND statements | Excel Worksheet Functions |