Left-Right-Mid-Find-Len question

mbk0523

New Member
Joined
Aug 29, 2012
Messages
25
Office Version
  1. 365
Platform
  1. Windows
Hi,

I know I should be using left/right/mid/find/len, but I am not good at writing those formulas. Hoping someone can help quickly.

Data in one columns looks like this:

1X10 GM
1X150 GM
1X8.3 GM
10X24 GM
2X6.2 GM
etc...

I need to get the total number of grams from here. So I need the output to look like this:

10
150
8.3
240
12.4

Basically, if the number before the X is greater than 1, multiply that by the number after the X (and before the GM). If the number before the X equals 1, just take the number after the X (and before the GM).

Thanks!!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Assuming data in A2 down try this formula in B2 copied down

=LEFT(A2,FIND("X",A2)-1)*MID(SUBSTITUTE(A2,"GM",""),FIND("X",A2)+1,9)
 
Upvote 0
Try

=LEFT(A1,FIND("X",A1)-1)*MID(A1,FIND("X",A1)+1,FIND(" ",A1)-FIND("X",A1))
 
Upvote 0
Hi,
i propose an another Solution. Choose a Name and attribute a formula of the form:
Code:
=EVALUATE("=" & (SUBSTITUTE(SUBSTITUTE(A2," GM", ""),"X","*")))
Best regards.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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