Formula to extract characters from text string

helphelp

New Member
Joined
Jun 29, 2019
Messages
8
Hi mrexcel forum,

Could you please suggest a formula to help me with this issue?
Issue A: I will like to extract out the numbers immediately before and after the dot. This is the volume information.
Issue B: I will like to extract the 3 characters immediately after the Volume information.

Example 1: AB BLACK SEDUCTION 3.4 EDT M (100111)
Issue A solution: Shows 3.4
Issue B solution: Shows EDT

Example 2: PACO OLYMPEA INTENSE 1.7 EDP L (108709)
Issue A solution: Shows 1.7
Issue B solution: Shows EDP

Thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to the MrExcel board!

Both your examples just have a single digit before/after the dot and 3-characters after that to extract for issue B. If that is true for all data, then try these formulas. If you need column B as a number, not text then add +0 to the end of the formula.
If it is not true for all then could we have a few more examples that show the full variety of what you have and what you want?

Excel Workbook
ABC
1AB BLACK SEDUCTION 3.4 EDT M (100111)3.4EDT
2PACO OLYMPEA INTENSE 1.7 EDP L (108709)1.7EDP
Extract Bits
 
Upvote 0
Welcome to the MrExcel board!

Both your examples just have a single digit before/after the dot and 3-characters after that to extract for issue B. If that is true for all data, then try these formulas. If you need column B as a number, not text then add +0 to the end of the formula.
If it is not true for all then could we have a few more examples that show the full variety of what you have and what you want?

Extract Bits

ABC
1AB BLACK SEDUCTION 3.4 EDT M (100111)3.4EDT
2PACO OLYMPEA INTENSE 1.7 EDP L (108709)1.7EDP

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:327px;"><col style="width:87px;"><col style="width:78px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B1=MID(A1,FIND(".",A1)-1,3)
C1=MID(A1,FIND(".",A1)+3,3)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Thanks!
 
Upvote 0
You're welcome. :)

Actually, if the final part of the strings after what you are searching for are space-single character-space-6 digit number in parentheses like you samples, you could also use these formulas.

Excel Workbook
ABC
1AB BLACK SEDUCTION 3.4 EDT M (100111)3.4EDT
2PACO OLYMPEA INTENSE 1.7 EDP L (108709)1.7EDP
Extract Bits
 
Upvote 0
You're welcome. :)

Actually, if the final part of the strings after what you are searching for are space-single character-space-6 digit number in parentheses like you samples, you could also use these formulas.

Extract Bits

ABC
1AB BLACK SEDUCTION 3.4 EDT M (100111)3.4EDT
2PACO OLYMPEA INTENSE 1.7 EDP L (108709)1.7EDP

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:327px;"><col style="width:56px;"><col style="width:56px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B1=LEFT(RIGHT(A1,18),3)
C1=LEFT(RIGHT(A1,14),3)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Thank you. Sorry to trouble you again. Unfortunately, some of the names look like this.

CK ALL 15 ML EDT L (110202)
DIOR JADORE 15ML EDP L REFILLABLE (111482)
DIOR JADORE 15OZ EDP L REFILLABLE (111482)
DIOR JADORE 15 OZ EDP L REFILLABLE (111482)

Is it possible to incorporate a formula to extract out the 15 which appears before the ML and OZ?

Thanks.
 
Upvote 0
This data looks quite different to the original.

1. If both sorts of values can exist, can you tell us in words how you would manually decide how to locate the numbers to extract and how to decide which letters to extract? There has to some logic to apply or else we can't tell excel what to do.

2. Is the number to extract always the only number in the string apart from in parentheses at the end? Or could there be other digits like "A1 BLACK SEDUCTION 3.4 EDT M (100111)"

3. How many different units of measurement can there be? (Your examples include "ML" and "OZ")

4. Are the texts always in upper case like your examples so far?

5. If a formula solution is not feasible, would a macro solution be acceptable?
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,891
Members
449,058
Latest member
Guy Boot

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top