ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I extract the numbers from the right side of the cell (https://www.excelbanter.com/excel-discussion-misc-queries/148488-how-do-i-extract-numbers-right-side-cell.html)

Dave L[_2_]

How do I extract the numbers from the right side of the cell
 
I need to be able to either set a variable value or use a formula that will
extract only the numbers that appear prior to the first "X" in a cell
starting from the right. For example:

3.5X16X6 Would return 6
15233.5X16X28 Would return 28
3.5X16X10.5 would return 10.5

Any ideas?

Elkar

How do I extract the numbers from the right side of the cell
 
Try this:

=MID(A1,FIND("~",SUBSTITUTE(A1,"X","~",LEN(A1)-LEN(SUBSTITUTE(A1,"X",""))))+1,999)

HTH,
Elkar


"Dave L" wrote:

I need to be able to either set a variable value or use a formula that will
extract only the numbers that appear prior to the first "X" in a cell
starting from the right. For example:

3.5X16X6 Would return 6
15233.5X16X28 Would return 28
3.5X16X10.5 would return 10.5

Any ideas?


Dave L[_2_]

How do I extract the numbers from the right side of the cell
 
Worked perfect. Thanks!


All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com