# Check if Array contains any occurence of the letter "F"

#### eddiegnz1

##### New Member
without VBA, how do I display the word "Fail" in cell 'C2' if any cell in an array contains the letter "F"? The array is not the entirety of column 'A' rather just A1:A30.

the array contains only two letters, which are either the letter "P" or the letter "F". If any one (or more than one) of those cells contains the letter "F" then the result is "Fail".

Kind thanks,
Eddie

### Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
try this:

=IF(COUNTIF(a1:a30,"f"),"Fail","Pass")

I assumed the opposite of Fail would be Pass.

Edit:
If the cell contains just single letters try

=If(countif(\$A\$1:\$A\$30, "F"), "fail",)

If they contain any other characters use

=IF(SUM(IFERROR(SEARCH("F",\$A\$1:\$A\$30,1),0))>0,"Fail","")

Press Ctrl + Shift + Enter as its an array formula

Last edited:
without VBA, how do I display the word "Fail" in cell 'C2' if any cell in an array contains the letter "F"? The array is not the entirety of column 'A' rather just A1:A30.

the array contains only two letters, which are either the letter "P" or the letter "F". If any one (or more than one) of those cells contains the letter "F" then the result is "Fail".

Try this formula...

=IF(COUNTIF(A1:A30,"F"),"Fail","")

You did not say what you wanted to happen if there was no F, so I left it blank (the "" part of the formula).

I would use =IF(ISNUMBER( MATCH("F",\$A\$1:\$A\$31,0) ), "Fail", "Pass")

Replies
0
Views
426
Replies
15
Views
947
Replies
5
Views
138
Replies
0
Views
102
Replies
0
Views
293

1,196,510
Messages
6,015,619
Members
441,908
Latest member
Guitar1st

### 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.

### Which adblocker are you using?

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

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