(IF) formula help!

J

joker_r_me

I need to create an (if) formula that isn't (if cell a = cell b then pass,
fail)... I need to make it more like (if Colum A = cell b then pass, fail)...
is that possible and how do I create it?
 
R

Ron Coderre

Just a guess.....

If you want to test that every non-blank cell in Col_A
matches the value in cell B1

Then try this:
C1: =IF(AND(COUNTA(A:A)<>0,COUNTIF(A:A,B1)=COUNTA(A:A)),"Pass","FAIL")

Note: the COUNTIF function is NOT case-sensitive.

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
J

joker_r_me

can this formula work with letters rather than numbers? Let me put an example
for you. Column A cells 2 - 77 are a bunch of file extensions. I want to see
if Cell C2 (file extension typed in there) = any of the extensions in column A
 
R

Ron Coderre

(This may be a double-post....my PC did something "funny" the first time I
tried to post)

With
A2:A77 containing file extentions (eg TXT, BAT, XLS, etc)

B2: (a file extention)

This formula tests if any of those cells matches the value in cell B2
=IF(COUNTIF(A2:A77,B2),"Pass","FAIL")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
J

joker_r_me

awesome.. thanks.. just made my job a lot easier than trying to run this in
SQL using a bunch of tables to run statements of comparison.
 
R

Ron Coderre

I'm glad that worked for you.....thanks for letting me know.


***********
Regards,
Ron

XL2002, WinXP
 
Top