Formula to remove last digit if it's a number

Blunder1

Active Member
Joined
Jun 2, 2010
Messages
250
Hi,

I need to a formula to remove the last digit if it a number on a text string, and to remove the first charaters which will always be consisitant. Ie:- 'Sum of Trade Capture' becomes 'Trade Capture' and 'Sum of Trade Capture2' becomes 'Trade Capture'

Thanks in advance

Blunder
<TABLE style="WIDTH: 132pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=176 border=0 x:str><COLGROUP><COL style="WIDTH: 132pt; mso-width-source: userset; mso-width-alt: 6436" width=176><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD id=td_post_1731680 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 132pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=176 height=17>
</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17></TD></TR></TBODY></TABLE>
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
<br /><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Sum of Trade Capture</td><td style=";">Trade Capture</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">Sum of Trade Capture2</td><td style=";">Trade Capture</td></tr></tbody></table><br /><br /><table cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B1</th><td style="text-align:left">=MID(<font color="Blue">IF(<font color="Red">ISNUMBER(<font color="Green">-RIGHT(<font color="Purple">A1,1</font>)</font>),LEFT(<font color="Green">A1,LEN(<font color="Purple">A1</font>)-1</font>),A1</font>),8,99</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B2</th><td style="text-align:left">=MID(<font color="Blue">IF(<font color="Red">ISNUMBER(<font color="Green">-RIGHT(<font color="Purple">A2,1</font>)</font>),LEFT(<font color="Green">A2,LEN(<font color="Purple">A2</font>)-1</font>),A2</font>),8,99</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
A slightly trimmed version ..

=MID(LEFT(A1,LEN(A1)-1+ISERR(RIGHT(A1)/1)),8,99)
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,820
Members
452,946
Latest member
JoseDavid

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