ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF Statements (https://www.excelbanter.com/excel-worksheet-functions/254132-if-statements.html)

mlynn

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!

JudithJubilee

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!


Don Guillett[_2_]

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!



Gary''s Student

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

Mike H

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!


David Biddulph[_2_]

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!




David Biddulph[_2_]

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!






Arvi Laanemets

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




David Biddulph[_2_]

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






mlynn

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!



All times are GMT +1. The time now is 06:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com