You are viewing limited content. For full access, please sign in.

Question

Question

If value is in a list of values, then A, else if a list of values, then B, else X

asked on October 14

How do I write an if statement that is like this is forms:

 

If Grade is in A1, B2, C3, then "A" else if Grade is in A5, B6, C7, then "B" else "X")

 

 

0 0

Answer

SELECTED ANSWER
replied on October 20

Try this:

=IF(OR(GRADE="A1",GRADE="B2",GRADE="C3"),"A",IF(OR(GRADE="A5",GRADE="B6",GRADE="C7"),"B","X"))
0 0

Replies

replied on October 14
=IF(GT(FIND(Grade,"A1B2C3"),0),"A",IF(GT(FIND(Grade,"A5B6C7"),0),"B","X"))

This is saying if the value of Grade is found in "A1B2C3" then "A", if the value of Grade is found in "A5B6C7" then "B", else "X"

2 0
replied on October 15

I'm looking for more.  If grade is A1 OR grade is B2 or grade is c3, A1B2C3 is not one entry it is 3 different entries. I actually have many grades that will be A and many others that will be B, and some miscellaneous that will be X...

0 0
SELECTED ANSWER
replied on October 20

Try this:

=IF(OR(GRADE="A1",GRADE="B2",GRADE="C3"),"A",IF(OR(GRADE="A5",GRADE="B6",GRADE="C7"),"B","X"))
0 0
replied on October 21

Mine is simpler and already does that. It is checking to see if the value of Grade is in the string "A1B2C3", so it's already accounting for the "or" possibility.

0 0
replied on October 21

I get an error with this one if I select C7.  "This field contains a calculation error. References: Grade."

This is the code: =IF(GT(FIND(Grade,"A1B2C3"),0),"A",IF(GT(FIND(Grade,"A5B6C7"),0),"B","X"))

 

Works if I put in any of A1, B2, or C3, but as soon as I put anything other than that I get an error.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.