How do I ignore blank cells in formula?

MurdochQuill

Board Regular
Joined
Nov 21, 2020
Messages
84
Office Version
  1. 365
Platform
  1. Windows
I'm using the following formula but I want to exclude blank cells from the countif criteria... "*"&'Sheet10'!$B$5:$B$9&"*"

=IF(OR(INDEX(COUNTIF(F2, "*"&'Sheet10'!$B$5:$B$9&"*"),)), "YES", "NO")

Anyone know how?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Minisheet please (read my signature)

Also try explaining ur process and expected result better.
its a bit of a guessing game, and there might be easier solution
Like filter function.
 
Upvote 0
Minisheet please (read my signature)

Also try explaining ur process and expected result better.
its a bit of a guessing game, and there might be easier solution
Like filter function.

Xl2bb is crashing for me atm.

Basically It's just a table of criteria on another page.
Criteria 1Criteria 2Criteria 3Criteria 4
DDCCBBAA
HHJJKKLL
BBMMNBBN

I want to find any matches with the above formula "=IF(OR(INDEX(COUNTIF(F2, "*"&'Sheet10'!$B$5:$B$9&"*"),)), "YES", "NO")"
F2 = either YES/NO if the criteria is returned. F2 is a jumbled mess of data like "DFGKFDJGHBB"

My table of criteria is dotted with blank cells at random, I just want to ignore them & treat it as a "not found", which would return "NO" if no other criteria is found.

I just thought there might be a more elegant way to do it, but I might just put in a nested IF.
 
Upvote 0
you are looking for a text string within another text string

Try using Search or find functions.

Book5
FGHIJKL
1DFGKFDJGHBBCriteria 1Criteria 2Criteria 3Criteria 4
2DDCCBBAA
3HHJJKKLL
4BBMMNBBN
5
6NoNoYesNo
7NoNoNoNo
8YesNoNoNo
9
Sheet1
Cell Formulas
RangeFormula
H6:K8H6=IF(IFERROR(FIND($H$2:$K$4,F1,1)>0,FALSE),"Yes","No")
Dynamic array formulas.
 
Upvote 0
you are looking for a text string within another text string

Try using Search or find functions.

Book5
FGHIJKL
1DFGKFDJGHBBCriteria 1Criteria 2Criteria 3Criteria 4
2DDCCBBAA
3HHJJKKLL
4BBMMNBBN
5
6NoNoYesNo
7NoNoNoNo
8YesNoNoNo
9
Sheet1
Cell Formulas
RangeFormula
H6:K8H6=IF(IFERROR(FIND($H$2:$K$4,F1,1)>0,FALSE),"Yes","No")
Dynamic array formulas.
This seems to give me a spill.

My criteria is done column by column. So I have criteria in column B on sheet 10. But I want to match the exact criteria somewhere within F2 on the current sheet.

=IF(IFERROR(SEARCH('Sheet10'!$B$5:$B$20,F2,1)>0,FALSE),"Yes","No")
 
Upvote 0
How about
Excel Formula:
=IF(SUM((Sheet10!B5:B9<>"")*(ISNUMBER(MATCH("*"&Sheet10!B5:B9&"*",F2,0)))), "YES", "NO")
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

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