Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-10-05
6
Medium Priority
?
59 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 332 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 332 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 332 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 53

Accepted Solution

by:
Ryan Chong earned 1004 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

730 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