Solved

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

Posted on 2016-10-05
6
45 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 32

Assisted Solution

by:Rob Henson
Rob Henson earned 83 total points
ID: 41829427
=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
ID: 41829429
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
ID: 41829432
=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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 50

Accepted Solution

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

Open in new window

1
 

Author Comment

by:AndreasHermle
ID: 41829619
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
ID: 41829623
Really, a great job from all of you. I really appreciate it. Regards, Andreas
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

786 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