dynamic truncuation

Victtor

Board Regular
Joined
Jan 4, 2007
Messages
170
Office Version
  1. 365
Platform
  1. Windows
I found this formula:

=LEFT(A1, FIND("?", A1&"?")-1)

that removes everything after a question mark including the question mark.

I need the formula to remove everything after the first number after the last alpha character in a cell:

3 examples:

2011617 Nacho Bar 206 42.83% 1,260.19 68.32% (remove everything after the 206)

2011618 rice 2 0.42% 0.02 0.00% (remove everything after the 2)

2015716 Shrimp Etouffee 1 0.21% 4.59 0.25% (remove everything after the 1)


I would like this without using VBA code if possible. however, I will even take VBA code if that is the only option.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Excel 2010
AB
12011617 Nacho Bar 206 42.83% 1,260.19 68.32% (remove everything after the 206)2011617 Nacho Bar 206
22011618 rice 2 0.42% 0.02 0.00% (remove everything after the 2)2011618 rice 2
32015716 Shrimp Etouffee 1 0.21% 4.59 0.25% (remove everything after the 1)2015716 Shrimp Etouffee 1
Sheet7
Cell Formulas
RangeFormula
B1=TRIM(LEFT(A1,FIND("%",A1)-6))
 
Upvote 0
I don't have a fix for it yet, but that will have a problem if the percent is ever 100.00%
 
Upvote 0
Perhaps:

=LEFT(A1,FIND("%",SUBSTITUTE(A1,"100.00%","0.00%"))-6)
 
Upvote 0
Thanks! this worked. The percent will never be 100.00%
 
Upvote 0

Forum statistics

Threads
1,224,749
Messages
6,180,730
Members
452,995
Latest member
isldboy

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