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

eddiegnz1

New Member
Joined
Jun 5, 2012
Messages
40
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.

Additional info:
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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
try this:

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

I assumed the opposite of Fail would be Pass.
 
Upvote 0
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:
Upvote 0
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.

Additional info:
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).
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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