Solved

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

Posted on 2016-10-05
45 Views
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
Question by:AndreasHermle

LVL 32

Assisted Solution

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

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

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

LVL 50

Accepted Solution

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

Author Comment

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

ID: 41829623
Really, a great job from all of you. I really appreciate it. Regards, Andreas
0

## Featured Post

Question has a verified solution.

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

### Suggested Solutions

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.