Solved

Extract strings / characters from the right till the first occurrence of a comma, using an excel formula

Posted on 2016-10-05
6
34 Views
Last Modified: 2016-10-05
Dear Experts:

I would like to extract strings from the right till the first occurrence of a comma, using an Excel formula.

Example

A1                                                               B1 (formula)
Scissors, bipolar, 23 cm                          23 cm
Laser, medical, 234 kg                            234 kg
Plate, regular, 87 holes                          87 holes

Could somebody help me with this probably nested formula.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
0
Comment
Question by:AndreasHermle
6 Comments
 
LVL 31

Assisted Solution

by:Rob Henson
Rob Henson earned 83 total points
Comment Utility
=RIGHT(A1,LEN(A1)-FIND(",",A1,FIND(",",A1,1)+1))

Assumes more than one occurrence of comma.
0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 83 total points
Comment Utility
if there are always 2 commas then you can use

=REPLACE(A1,1,FIND("#",SUBSTITUTE(A1,",","#",2)),"")

If the number of commas can vary then use

=REPLACE(A1,1,FIND("#",SUBSTITUTE(A1,",","#",LEN(A1)-LEN(SUBSTITUTE(A1,",","")))),"")
0
 
LVL 8

Assisted Solution

by:Koen
Koen earned 83 total points
Comment Utility
=RIGHT(A2;LEN(A2)-FIND(CHAR(1);SUBSTITUTE(A2;",";CHAR(1);(LEN(A2)-LEN(SUBSTITUTE(A2;",";"")))/LEN(",")))-1)

(you might need to replace ; with , depending on your regional settings)

this will work as soon as 1 comma is present, and return an error when no comma is present
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 49

Accepted Solution

by:
Ryan Chong earned 251 total points
Comment Utility
or something like this:
=TRIM(RIGHT(SUBSTITUTE(A1, ",", REPT(" ", 100)), 100))

Open in new window

1
 

Author Comment

by:AndreasHermle
Comment Utility
A really good job from all of you, all of the formulas work just fine.

If the length of the formula is a criterion, Ryan Chong's formula is the best one.
Rob Henson's formula is also very concise but I just had cases in which just one comma was present.

I will distribute the points accordingly. Again, thank you very much for your superb and professional help. I really appreciate it. Regards, Andreas
0
 

Author Closing Comment

by:AndreasHermle
Comment Utility
Really, a great job from all of you. I really appreciate it. Regards, Andreas
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
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…

763 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

8 Experts available now in Live!

Get 1:1 Help Now