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!!
 
I might be tempted to use SEARCH() rather than FIND() to allow for 1x8.3 GM
Code:
=LEFT(A1,SEARCH("X",A1)-1)*MID(A1,SEARCH("X",A1)+1,SEARCH(" ",A1)-SEARCH("X",A1))
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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