IF "x" is within all columns

Pizzio

Active Member
Joined
Apr 28, 2005
Messages
250
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?
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,177
Office Version
365
Platform
Windows
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.
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,645
Maybe:
Code:
=IF(COUNTIF(column range,"*exclude*")>0,"exclude included","exclude not included")
where column range would be something like B1:XFD1 ...
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,840
=IF(COUNTIF(A1:IP1,"*exclude*"),"exclude included","exclude not included")
 

Toadstool

Active Member
Joined
Mar 5, 2018
Messages
297
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
1Col 1Col 2Col 3Col 4Col 5Col 6
2Exclude not includedandtowhichandforof
3exclude includedexcludesoundlygivetprotestationofof
4Exclude not includedthebetterifirst that tis ask exclude better thetisthat
5Exclude not includedtellmanpoorbodyIwere
6exclude includeddemandnightsflyrenderherefordlazar
7Exclude not includedthoughmeancannotandthewell
8exclude includedtominglebidfirst that tis ask exclude better thebeking
9Exclude not includediwilltoshalllikewiseto
10Exclude not includedfordesireandwithdefuncttides
11exclude includedtakedevilbidstarvingobjectsexclude
12exclude includedtheshaltgonegreyandExclude

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Pizzio

Worksheet Formulas
CellFormula
A2 to A6
=IF(ISNA(MATCH("exclude",B2:IR2,0)),"Exclude not included","exclude included")
A7
to A101
=IF(ISNA(MATCH("*exclude*",B7:IR7,0)),"Exclude not included","exclude included")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



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.
 

Forum statistics

Threads
1,078,435
Messages
5,340,250
Members
399,361
Latest member
Linford

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top