Check for Multiple Text Strings in a Cell

David44357

New Member
Joined
Dec 22, 2011
Messages
8
This formula will search the B cell for a word and post an indicator if it contains the keyword.
=IF(ISNUMBER(SEARCH("citations",B170)),"1", "")

My obstacle is I need four of these that each search for 3-4 different keywords.

I've tried things like:
=IF(ISNUMBER(OR(SEARCH("citations",B170)), SEARCH("sources",B170))),"1", "")

But I get errors. Does anyone know how to get a formula that checks a cell for multiple keywords? I keep trying to put the OR in different places without success.

-David
 

Hi,
First of all, :rolleyes:thanks:rolleyes: to all who have contributed to this threat, it's been very helpful. Now, I just need a :pRocket Scientist:p (or Masochist) to help me put some of this on steroids for a book keeping system!

I have data I drop from a bank dump in columns B through to E, Columns F through to H sort Db and Cr and some tagging.
K though M categorise Expenses, M is for Income

I use in-cell drop lists to categorise transactions, and at year end Look at a Profit and Loss with formulas like:
=COA!$H$2 & " " & TEXT(0-
SUMPRODUCT(SUMIFS(
INDIRECT("'"&SheetListSuncorp&"'!d2:d5000"),
INDIRECT("'"&SheetListSuncorp&"'!L2:L5000"),COA!$H$2,
INDIRECT("'"&SheetListSuncorp&"'!K2:K5000"),E_Bus)),
"($#,##0.00)")

Wouldn't it be nice though, if an array could check out the descriptors in each line and assign a category in K? Even L and M where required?

I have this:
B C D G K L M N (income)
09-Mar-16Upwork Global Inc Dublin IE-34.74-34.74BusinessContractors
09-Mar-16POST PERTH ST GEOR PERTH AU-16.95-16.95General LivingOther Living
09-Mar-16BOOST JUICE CARILLON CITYPERTH AU-14.60-14.60General LivingFast Food
08-Mar-16Upwork Global Inc Dublin IE-62.35-62.35BusinessContractors
08-Mar-16BASSENDEAN PHARMACY BASSENDEAN AU-20.60-20.60BusinessMedicalPharmaceutical
07-Mar-16Upwork Global Inc Dublin IE-69.54-69.54BusinessContractors
07-Mar-16COLES 0379 MAYLANDS AU-109.75-109.75General LivingFood
06-Mar-16BUNNINGS 451000 MORLEY AU-122.79-122.79HomeOther (home | maintenance)
06-Mar-16CP MASSAGE MORLEY AU-65.00-65.00General LivingMedicalMassage
05-Mar-16HISCO WEST PERTH AU-26.40-26.40-
05-Mar-16BODY HQ MASSAGE CENT MAYLANDS AU-70.00-70.00General LivingMedicalMassage
05-Mar-16BODY HQ MASSAGE CENT MAYLANDS AU-65.00-65.00General LivingMedicalMassage
05-Mar-16HARVEY NORMAN AV/IT WEST PERTH AU-330.00-330.00HomeEquipment
05-Mar-16HARVEY NORMAN AV/IT WEST PERTH AU-59.00-59.00HomeEquipment
04-Mar-16TPG INTERNET PTY LTD NORTH RYDE AU-99.95-99.95BusinessOfficeTelephone | Internet

<tbody>
</tbody>

Note:
- The first row (Upwork) is no 4409
- B4413 contains Bassendean Pharmacy

In K4413 is:
=IF(COUNT(SEARCH(Keyword_ExpenseBusiness,C4413)),"Business",IF(COUNT(SEARCH(Keyword_ExpenseGL,C4413)),"General Living",""))


B4409 results in Business appearing in K4409, which is fine, it is a business item
B4413 results in Business appearing in K4413, which is not fine, it is a General Living item
..so why is this, is it because you cant next an IF in an array? Is the syntax wrong?

Where:
Income Keyword table
Mob AllPension
PensionPension
Expense | General Living Keyword table
KeywordExpense CategoryExpense Sub-CategoryExpense Item
ChemistGeneral Living
PHARMACYGeneral Living
MassageGeneral Living
Expense | Business Keyword table
KeywordExpense CategoryExpense Sub-CategoryExpense Item
INTERNETBusiness

<tbody>
</tbody>
Also, I'm sure some Rocket Scientist can come up with a better idea, as I have tables, eh?
I played around with this:
=IFERROR(LOOKUP(9.99999999999999E+307,SEARCH(Keyword_ExpenseGL_Table,$B3),OFFSET(Keyword_ExpenseGL_Table,0,1)),"")
...but using an offset could cause problems

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Not exactly, but as my conundrum is similar, I thought it may benefit us both to be in the same post
 
Upvote 0
hi, if anyone still interested, i was looking for a shorter version of what already have. i like item that was posted here for multiple tests in 1 cell (if 1 of the only examples showing that), for
=IF(COUNT(SEARCH({"test1","test2"},DI1585)),1,0) 'for 1 cell only, not case sens, cannot use defined names

i was looking for a shorter version of the following. that answer might be making a user defined function (UDF) to do the same / shorten the name to be something like: SUMF({"test1","test2"},B9:F9)
=IF(SUMPRODUCT(--ISNUMBER(FIND({"test1","test2"},B9:F9)))>0,1,0) multiple strings, range of cells, case sens (must match), defined names: yes, PROBLEM: too long if want to use many times

=IF(SUMPRODUCT(--ISNUMBER(FIND(TOP,CV1581:DC1581)))>0,1,0) defined names, entry has same text (with semi-colons): ={"test1";"test2"} ={"A";"a";2}

EXAMPLE: (name defined name eg: TOP as any name you want)
=SUMPRODUCT(--ISNUMBER(FIND(TOP,J9)))>0
- remote modify cond. formats
- TOP: insert name DEFINE ={2;"A";"a"}
- shortcut: built-in menu copy
 
Last edited:
Upvote 0
Staff: still trying to edit my post. maybe move time up to 3 hours or something.. PS, might be able to swap FIND out with SEARCH, not sure of what different. FIND has worked for me.
 
Upvote 0
hi, if anyone still interested, i was looking for a shorter version of what already have. i like item that was posted here for multiple tests in 1 cell (if 1 of the only examples showing that), for
=IF(COUNT(SEARCH({"test1","test2"},DI1585)),1,0) 'for 1 cell only, not case sens, cannot use defined names

i was looking for a shorter version of the following. that answer might be making a user defined function (UDF) to do the same / shorten the name to be something like: SUMF({"test1","test2"},B9:F9)
=IF(SUMPRODUCT(--ISNUMBER(FIND({"test1","test2"},B9:F9)))>0,1,0) multiple strings, range of cells, case sens (must match), defined names: yes, PROBLEM: too long if want to use many times

=IF(SUMPRODUCT(--ISNUMBER(FIND(TOP,CV1581:DC1581)))>0,1,0) defined names, entry has same text (with semi-colons): ={"test1";"test2"} ={"A";"a";2}


think you can swap: FIND out for: SEARCH not sure of differences.
EXAMPLE: (name defined name eg: TOP as any name you want)

=SUMPRODUCT(--ISNUMBER(FIND(TOP,J9)))>0
- remote modify cond. formats
- TOP: insert name DEFINE ={2;"A";"a"}
- shortcut: built-in menu copy
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,840
Members
449,471
Latest member
lachbee

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