View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pomegranate-man[_2_] pomegranate-man[_2_] is offline
external usenet poster
 
Posts: 14
Default check data from different cells

I have to check data from different cells in different columns at the
same time in one "if" formula with several "if" conditions?
How can I compare them?
Ex:
A1=0 B1=12 D1=11 E1=0
A2=34 B2=56 D2=0 E2=0
A3=78 B3=0 D3=0 E3=22
A4=0 B4=0 D4=0 E4=0


I'm not quite sure what's intended.

If the test is "one of the four sets of must hold," then maybe something
like this would work:
=OR(AND(A1=0,B1=12,D1=11,E1=0),
AND(A2=34,B2=56,D2=0,E2=0),
AND(A3=78,B3=0,D3=0,E3=22),
AND(A4=0,B4=0,D4=0,E4=0))

If the test is to identify which of the four are violated, then maybe this:
="Errors: "&
IF(AND(A1=0,B1=12,D1=11,E1=0),"","1 ")&
IF(AND(A2=34,B2=56,D2=0,E2=0),"","2 ")&
IF(AND(A3=78,B3=0,D3=0,E3=22),"","3 ")&
IF(AND(A4=0,B4=0,D4=0,E4=0) ,"","4 ")

Or maybe the test is something different.