Nested IF Statements?

stormwind6

New Member
Joined
Nov 29, 2012
Messages
8
I'm trying to evaluate the value of 3 cells according to the following principles:
1) If all 3 of the cells have the same value, all 3 are correct
2) If 2 of the cells have the same value and 1 is different, then the 2 are correct and the 1 is wrong.
3) If all 3 of them have different values all 3 are wrong.​

I have a formulas for Cells A, B, and C:
A: =IF(A-[B-C]<>A, "OK", "WRONG")
B: =IF(B-[C-A]<>B, "OK", "WRONG")
C: =IF(C-[A-B]<>C. "OK", "WRONG")​

This allows principal 2 to work (telling me which cell is wrong), but it says that all 3 cells are wrong when A=B=C, and all are correct when A, B, and C are different. It should be reversed.

I know I'm close, but my brain is tired and I can't figure out how to nest an additional IF statement that would make all 3 principals true.

Can somebody help me out?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
A: =if(countif($a$1:$c$1,a1)>1,"ok","wrong")
b: =if(countif($a$1:$c$1,b1)>1,"ok","wrong")
c: =if(countif($a$1:$c$1,c1)>1,"ok","wrong")
 
Upvote 0
Try this

Assuming your cells are A1, B1, C1

in D1
=LOOKUP((A1=B1)*1+(A1=C1)*2+(B1=C1)*4,{0,1,2,3,4,5,6,7},{"ABC","C","B","ERR","A","ERR","ERR","OK"})

It's prob long winded but it returns which cell is incorrect.
The combinations 3,5,6 should not occur hence the ERR indicator.
 
Upvote 0

Forum statistics

Threads
1,215,419
Messages
6,124,796
Members
449,189
Latest member
kristinh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top