Solved

Using IFERROR in Excel

Posted on 2016-07-25
6
52 Views
Last Modified: 2016-07-30
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
Comment
Question by:John Fistere
6 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41728679
do you have a sample can upload here? it would be easier for troubleshooting
0
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 250 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

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

Your solution worked perfectly.

Thanks!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 28

Assisted Solution

by:Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj) earned 250 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)

Open in new window

0
 
LVL 2

Author Comment

by:John Fistere
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 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41728884
You're welcome!

The following syntax of Replace function is help you....

=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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now