Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Using IFERROR in Excel

Posted on 2016-07-25
Medium Priority
77 Views
I have a column of names, some of which include a parenthetical expression. I want to create another column of names with the parenthetical expression excluded. I have tried IF(ISERROR(... In about every way I can think of. To give you the basic idea, one of my attempts looks like this:

=IF(ISERROR(IF(AND(FIND("(",M45),FIND(")",M45)),(LEFT(M45,FIND("(",M45)-2))&MID(M45,FIND(")",M45)+1,256),M45)),M45)

In this version if there is a parenthetical phrase, the result is FALSE instead of the desired name. In other cases, I get only the non--parenthetical name to work, or I get too many or too few parentheses, or too many or too few variables. The result I'm looking for looks like this:

James Kirk                                            James Kirk
Montgomery (Scotty) Scott                    Montgomery Scott
0
Question by:John Fistere
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 53

Expert Comment

ID: 41728679
do you have a sample can upload here? it would be easier for troubleshooting
0

LVL 47

Accepted Solution

Wayne Taylor (webtubbs) earned 1000 total points
ID: 41728685
Try this one...

=IFERROR(IF(AND(FIND("(",M45),FIND(")",M45)),(LEFT(M45,FIND("(",M45)-2))&MID(M45,FIND(")",M45)+1,256),M45), M45)
0

LVL 2

Author Comment

ID: 41728774
Aha. I was rarely careless about the difference between IFERROR and ISERROR.

Thanks!
0

LVL 32

Assisted Solution

Subodh Tiwari (Neeraj) earned 1000 total points
ID: 41728791
Or you may also use the following formula to get the desired output...

``````=IFERROR(REPLACE(M45,FIND("(",M45),FIND(")",M45)-FIND("(",M45)+1,""),M45)
``````
0

LVL 2

Author Comment

ID: 41728871
It works, too. Interesting approach. I'll have to spend a little more time with it to see precisely how it works.

Thanks

John
0

LVL 32

Expert Comment

ID: 41728884
You're welcome!

=REPLACE(old_text, start_num, num_chars, new_text)

Where
old_text is the original string/Text in which you want to replace a part string in it, in this case it is M45

start_num is the starting position of the text you want to replace, in this case it is "("

num_chars would be the number of characters you want to replace, in this case the characters between "(" and ")" including them, in this case e.g. it is (Scotty)

new_text would be string you would replace the previous string with, in this case you would replace "(some string here)" with a null string.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calculâ€¦
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, tâ€¦
###### Suggested Courses
Course of the Month6 days, 15 hours left to enroll