Solved

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

Posted on 2016-10-05
6
49 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
[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
  • Learn & ask questions
6 Comments
 
LVL 33

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

My experience with Windows 10 over a one year period and suggestions for smooth operation
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

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