Text after sign need to separate

DIPASGL

New Member
Joined
Oct 26, 2022
Messages
39
Office Version
  1. 2003 or older
Platform
  1. Windows
Hi all

I would like to separate text and number in a cell after hyphen sign, then multiply with quantity.

On left side my description has got 1000l or 20l or .45kg etc sometimes and I want the result as per last column 3000(1000*3) so on - Thanks

DIESEL MAX 15W/40 CK4 - 1000L33000
GEAR OIL 80W/90 - 20L32640
HYDRAULIC 32 - 20L16320
HYDRAULIC 46 - 20L32640
HYDRAULIC 46 - 1000L22000
HYDRAULIC 68 - 1000L1010000
HYDRAULIC H 68 - 1000L11000
GREASE LX2 - 0.45KG640288
GREASE LXMO2 - 180KG1180
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
How about
Fluff.xlsm
ABC
1
2DIESEL MAX 15W/40 CK4 - 1000L33000
3GEAR OIL 80W/90 - 20L32640
4HYDRAULIC 32 - 20L16320
5HYDRAULIC 46 - 20L32640
6HYDRAULIC 46 - 1000L22000
7HYDRAULIC 68 - 1000L1010000
8HYDRAULIC H 68 - 1000L11000
9GREASE LX2 - 0.45KG640288
10GREASE LXMO2 - 180KG1180
Master
Cell Formulas
RangeFormula
C2:C10C2=SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("-",A2)+1,100),"L",""),"KG","")*B2
 
Upvote 0
Based on the sample data in your similar thread it seems that you may have quite a variety of units including in upper/lower case and full/abbreviated versions. If that is still the case then perhaps basically my formula over there ..

BTW, it would be helpful if you followed up your questions with feed-back to helpers so that they know if their suggestions are useful to you and if not, why not. ;)

23 06 14.xlsm
ABC
1
2DIESEL MAX 15W/40 CK4 - 1000L33000
3GEAR OIL 80W/90 - 20L32640
4HYDRAULIC 32 - 20L16320
5HYDRAULIC 46 - 20L32640
6HYDRAULIC 46 - 1000L22000
7HYDRAULIC 68 - 1000L1010000
8HYDRAULIC H 68 - 1000L11000
9GREASE LX2 - 0.45KG640288
10GREASE LXMO2 - 180KG1180
DIPASGL
Cell Formulas
RangeFormula
C2:C10C2=REPLACE(LEFT(A2,LOOKUP(1,-MID(A2,ROW(INDEX(A:A,1):INDEX(A:A,99)),1),ROW(INDEX(A:A,1):INDEX(A:A,99)))),1,FIND("-",A2),"")*B2
 
Upvote 0
Based on the sample data in your similar thread it seems that you may have quite a variety of units including in upper/lower case and full/abbreviated versions. If that is still the case then perhaps basically my formula over there ..

BTW, it would be helpful if you followed up your questions with feed-back to helpers so that they know if their suggestions are useful to you and if not, why not. ;)

23 06 14.xlsm
ABC
1
2DIESEL MAX 15W/40 CK4 - 1000L33000
3GEAR OIL 80W/90 - 20L32640
4HYDRAULIC 32 - 20L16320
5HYDRAULIC 46 - 20L32640
6HYDRAULIC 46 - 1000L22000
7HYDRAULIC 68 - 1000L1010000
8HYDRAULIC H 68 - 1000L11000
9GREASE LX2 - 0.45KG640288
10GREASE LXMO2 - 180KG1180
DIPASGL
Cell Formulas
RangeFormula
C2:C10C2=REPLACE(LEFT(A2,LOOKUP(1,-MID(A2,ROW(INDEX(A:A,1):INDEX(A:A,99)),1),ROW(INDEX(A:A,1):INDEX(A:A,99)))),1,FIND("-",A2),"")*B2
Thanks Peter, its working fine except row 11 that I missed to mention before
MT BRAKE CLEANER - 400G

where my description has got g which means grams and when I want to multiply 400g I want my formula to pick .45 multiply with qty. The formula you gave is good except for g above row 11. Any idea how can I fix this. Thanks
 
Upvote 0
How about
Fluff.xlsm
ABC
1
2DIESEL MAX 15W/40 CK4 - 1000L33000
3GEAR OIL 80W/90 - 20L32640
4HYDRAULIC 32 - 20L16320
5HYDRAULIC 46 - 20L32640
6HYDRAULIC 46 - 1000L22000
7HYDRAULIC 68 - 1000L1010000
8HYDRAULIC H 68 - 1000L11000
9GREASE LX2 - 0.45KG640288
10GREASE LXMO2 - 180KG1180
Master
Cell Formulas
RangeFormula
C2:C10C2=SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("-",A2)+1,100),"L",""),"KG","")*B2
Hi Fluff,
Thanks for help.
Your formula works fine except when my description has got g means gram like below, its giving error
#VALUE!

My figures as below

MT BRAKE CLEANER - 400G96 qty

I want to achieve .45 multiply 96 as I want your formula to put decimal in case of gram and then multiply. Thanks
 
Upvote 0
What other conditions are there that you haven't mentioned?
 
Upvote 0
Also, what is the logic for 400G to become 0.45 and not 0.4?
 
Upvote 0
What other conditions are there that you haven't mentioned? No other conditions. I have data like below
DescriptionQty. Received (Base)
GEAR SYN 75W/140 - 20L8
GEAR SYN - 75W/90 -200g32
GEAR SYN 75W/90 -5L64
PREMIUM SN -5W/30 - 20L48
PREMIUM SN 5W30 - 1000L2

I want to multiply qty with all number in description column that comes after hyphen. Thanks
 
Upvote 0
Sorry Fluff I just wrote by mistake
Did you mean Peter? ;)


No other conditions.
Looks like there are to me -
  • Now you have data with multiple "-" symbols in the one line which we have not seen before.
    1686826672069.png
  • You also now have an example where there is no space character after the dash, unlike all the earlier samples.
    1686826695730.png
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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