You are here:

Excel/Can #VALUE be used in a logical test?

Advertisement


Question
I have a set of 10 strings in 10 different cells. I want to test to see if a certain text string is in any of these 10 cells. My approach is to use the CONCATENATE fx to combine all the the cells and then use the FIND or SEARCH fx to check and see if the string I'm looking for is present in the combined string. I then want a cell to display a certain value if the text is there, and another value if it is not there. It works fine if the text value is present. I just use an IF statement to see if the SEARCH fx returns a value. The problem is that if the text I'm looking for is not there the SEARCH returns a #VALUE. Is there anyway to use the #VALUE return in a logical test, or is there another fx that will perform the task I need?

Answer
You can use the ISERROR formula for this.  For example:
=IF(ISERROR(Your_condition_here),"Error",Your_result)
The ISERROR formula returns TRUE if its parameters evaluates to an error, and FALSE otherwise.  You can use it on your formulas as you see fit.

Hope this helps,
Miguel
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

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Miguel Zapico

Expertise

I am recycling to Excel 2010, so I am taking an extended leave while I work on keeping myself an expert on this matter.

Experience

I have worked with Excel for the past 12 years, in various environments.

Organizations
NYPC (New York PC users group)

Organizations
NYPC (New York PC users group)

Education/Credentials
MCSE in Windows NT

©2012 About.com, a part of The New York Times Company. All rights reserved.