View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_651_] Rick Rothstein \(MVP - VB\)[_651_] is offline
external usenet poster
 
Posts: 1
Default IF/AND Formula Problem

Can you tell us what those conditions are? Will there be more than 7 of them
(if so, you will have problems with the nested IF testing)?

Rick


"CT" wrote in message
...
Thank you Rick, I did simplify my example and I will have other conditions
going forward.

"Rick Rothstein (MVP - VB)" wrote:

The other two responses (so far) have discussed why your code didn't work
as
you expected. As for a solution... IF what you posted are the only
possible
entries in the B1 and C1, then this formula is more compact than the
approach you were attempting...

=CHOOSE(1+(B1="-")+2*(C1="Yes"),"SPINS","No Match","SPINS TOL","TOL")

If you have other conditions that you did not post, the above can
probably
be modified to handle them (depending on how many there are).

Rick


"CT" wrote in message
...
In column A I need to return a value based on critera found in columns
B
and C.
If B1="-" and C1="-" return "No Match" in A1.
If B10 and C1="Yes" return "SPINS TOL" in A1.
If B1="-" and C1="Yes" return "TOL" in A1
If B10 and C1="-" return "SPINS" in A1.

Here is the formula I am using now.
=IF(AND(B1="-",C1="-"),"No Match",IF(AND(B10,C1="Yes"),"SPINS
TOL",IF(AND(B1="-",C1="Yes"),"TOL",IF(AND(B10,C1="-"),"SPINS"))))

Here are my results:
A B C
1 No Match - -
2 SPINS TOL 1 Yes
3 SPINS TOL - Yes
4 SPINS 2 -

I cannot get it to return "TOL" in A3. What am I doing wrong?