IF "x" is within all columns

Pizzio

Active Member
Joined
Apr 28, 2005
Messages
275
I'm looking for a formula to put in 100 rows to tell me if "exclude" is populated in any of the 250 columns. If yes, then "exclude included" If no, then "Exclude not included" Any ideas?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Use a COUNTIF function to count the number of times it occurs. You just want to see if there is at least one there, i.e.
=IF(COUNTIF(range to check,"exclude")>0,"exclude included","exclude not included")

Just substitute the range you are checking into the formula.
 
Upvote 0
Maybe:
Code:
=IF(COUNTIF(column range,"*exclude*")>0,"exclude included","exclude not included")
where column range would be something like B1:XFD1 ...
 
Upvote 0
=IF(COUNTIF(A1:IP1,"*exclude*"),"exclude included","exclude not included")
 
Upvote 0
I see you have COUNTIF covered so I'll go with MATCH.

The A2 to A6 formula looks for "exclude" by itself.
The A7 to A101 formula includes "exclude" as a part of any string.


ABCDEFG
Exclude not includedandtowhichandforof
exclude includedexcludesoundlygivetprotestationofof
Exclude not includedthebetterifirst that tis ask exclude better thetisthat
Exclude not includedtellmanpoorbodyIwere
exclude includeddemandnightsflyrenderherefordlazar
Exclude not includedthoughmeancannotandthewell
exclude includedtominglebidfirst that tis ask exclude better thebeking
Exclude not includediwilltoshalllikewiseto
Exclude not includedfordesireandwithdefuncttides
exclude includedtakedevilbidstarvingobjectsexclude
exclude includedtheshaltgonegreyandExclude

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Col 1[/TD]
[TD="align: center"]Col 2[/TD]
[TD="align: center"]Col 3[/TD]
[TD="align: center"]Col 4[/TD]
[TD="align: center"]Col 5[/TD]
[TD="align: center"]Col 6[/TD]

[TD="align: center"]2[/TD]

[TD="align: center"]3[/TD]

[TD="align: center"]4[/TD]

[TD="align: center"]5[/TD]

[TD="align: center"]6[/TD]

[TD="align: center"]7[/TD]

[TD="align: center"]8[/TD]

[TD="align: center"]9[/TD]

[TD="align: center"]10[/TD]

[TD="align: center"]11[/TD]

[TD="align: center"]12[/TD]

</tbody>
Pizzio

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]A2 to A6
[/TH]
[TD="align: left"]=IF(ISNA(MATCH("exclude",B2:IR2,0)),"Exclude not included","exclude included")[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]A7
to A101
[/TH]
[TD="align: left"]=IF(ISNA(MATCH("*exclude*",B7:IR7,0)),"Exclude not included","exclude included")[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]



P.S. Test data from my random extract of 100,000 words from Shakespeares plays, which apparently did not include "exclude" until I made it so.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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