Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to compare 6 cells, and get a pass or fail at the end, but in Excel it looks like it will only let me have 5 cells. I'm not sure how to word it.

like for example:

Pseudocode: if (A1 and B1 and C1 = A100 and B100 and C100 then Pass else Fail)
=if(A1;B1;C1=A100;B100;C100,Pass,Fail)

That doesn't work, and Excel says I typed a few errors.

Please can someone help me with this?

Updated Ok, to make this a little more clearer, here is an example of what I want to achieve:

A1 = 1.0.0.0
B1 = 01/01/2000
C1 = 00:30

A100 = 1.0.0.0
B100 = 01/01/2000
C100 = 00:30

Therefore the cell I want the answer will be Pass.

But if one of those cells don't match up, then it will be a Fail.

share|improve this question
    
Try using the AND keyword! –  Dave Rook Aug 20 '13 at 10:01
3  
=IF(AND(A1=A100,B1=B100,C1=C100),"pass","fail") –  nixda Aug 20 '13 at 10:06
    
More reading about AND –  Dave Rook Aug 20 '13 at 10:07
    
Thanks @nixda, it has worked, but is showing Pass even if the fields are all blank. –  Kevdog777 Aug 20 '13 at 10:23
    
Please edit your post and maybe provide a data sample. It is not clear if the matches are in pairs or if any of A1, B1, C1 should be matched to any of A100, B100, C100. If all the fields are blank then, of course the formula will return pass. If that is not the result you expect, then you need to explain the input, the logic, and the expected output. –  teylyn Aug 20 '13 at 10:44
show 2 more comments

1 Answer

up vote 1 down vote accepted

Since the data is a mix of text and numbers, you can check the length of all concatenated cells to see if it's greater than zero:

=IF(AND(A1=A100,B1=B100,C1=C100,LEN(A1&B1&C1)>0),"pass","fail")

share|improve this answer
    
Thank you for answering. I didn't like it that if the cells were empty, that it was failing, so I have blanked the "fail" out - so it would look like this: ...>0),"Pass","") –  Kevdog777 Aug 21 '13 at 9:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.