You are here:

Excel/Compounding Formulae


QUESTION: Dear Tom, I consulted you many years ago and you gave me fantastic advise for excel problems hence I am returning with another question.

I am using Excel 2010 and producing a spreadsheet for my good friend to help him evaluate enquiries.

I am using the following formula for identifying substrings in a cell =IF(ISNUMBER(SEARCH("thailand",$cell)),"Yes","") and I wish to check the cell for the following values also "cambodia", "taiwan", "china", "vietnam". I wish to combine the search into one formula so any and all found will return YES. I am having a brain freeze on this and would greatly appreciate your help.

Very best regards


If I understand you want to return yes if any of the five locations are in the range referred to by $cell, then I would use this.


Tom Ogilvy

[an error occurred while processing this directive]---------- FOLLOW-UP ----------


It did not work out for me but I feel it is because I did not clearly state the searched content being in one cell not an array. I will try and show below what I am doing more clearly. I am using an array of 5 cells to return values because of the max 7 arguments with the IF function and in two cells I require 8 arguments. I can send an excel file showing what I require if the following does not explain well enough.

[search value] [asia] [europe1] [europe2] [mid east] latin am1][latin am2]

[search value]
Vietnam_TESOL; Vietnam_TESOL; Vietnam_TESOLPlus; Vietnam_Volunteer; Vietnam_VolPlus; Czech_TESOL; Greece_TESOL; Hungary_TESOL; Florence_TESOL; Russia_TESOL; Barcelona_TESOL; Argentina_TESOL; Brazil_TESOL; Chile_TESOL; CostaRica_TESOL;


[europe 1]

[europe 2]

This works for me but I have to split the europe search into 2 cells because if I have 8 arguments nested under the IF function returns an error. I would like a single cell search to return the result I seek for europe 1 & 2 search. I also have the same problem with Latin america having 8 arguments.

I know I can nest up to 64 IF functions within one cell but not sure how to achieve this.

I hope this clarifies what I am seeking to achieve. I can also send a sample spreadsheet showing exactly what I am trying to do but I neeed you to let me know how to do this.

Best regards



So yes, I assumed a single value in the cell being examined.  It appears you want to match substrings in that single cell.   I would change each string from  

but back to your formulas:
No reason this shouldn't work



the number of conditions in an OR statement is not nesting.  Your isnumber(search))  is nested, but it is only three deep counting the OR statement.

all that said,  this is the same as the above formula:


and simpler I think.

Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2017 All rights reserved.

[an error occurred while processing this directive]