Remove all before first lower case character

xluserg

Board Regular
Joined
Jan 30, 2010
Messages
121
Office Version
  1. 365
Platform
  1. Windows
Hi all

How would I remove everything before a lower case character


In column M
I have starting at M10:60






example


3263 7 h
3502U- 10 ht
445334 11 t
35-409 6
3-355P 7 w 1 v
936423 7
120-PP 9
7-0565 4
/34303 9 h 1
P78062 8
75566F 4 b
/34-PU 8 t




would leave




h
ht
t
blank cell
w 1 v
blank cell
blank cell
blank cell
h 1
blank cell
b
t




Thanks all in advance

Graham
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try:

MN
103263 7 hh
113502U- 10 htht
12445334 11 tt
1335-409 6
143-355P 7 w 1 vw 1 v
15936423 7
16120-PP 9
177-0565 4
18/34303 9 h 1h 1
19P78062 8
2075566F 4 bb
21/34-PU 8 tt

<tbody>
</tbody>
Sheet12

Worksheet Formulas
CellFormula
N10=IFERROR(MID(M10,AGGREGATE(15,6,FIND(ROW(INDIRECT("97:122"))),M10),1),LEN(M10)),"")

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Your formula is missing the CHAR function:
=IFERROR(MID(A1,AGGREGATE(15,6,FIND(CHAR(ROW(INDIRECT("97:122"))),A1),1),LEN(A1)),"")

I'm curious though why 5 (MIN) doesn't work as the function for AGGREGATE
 
Upvote 0
Ugh! Thanks for catching that Scott! My HTML Maker has been acting weird, it sometimes adds/deletes characters. I normally double check, but I guess I missed it this time. That is the right formula.

And 5 (MIN) doesn't work in AGGREGATE because the function codes less than 14 only work on ranges of data (A1:A10), not arrays {1,2,3}.
 
Upvote 0
In case you might be interested in a fairly succinct user-defined function. To implement ..
1. Right click the sheet name tab and choose "View Code".
2. Copy and Paste the code below into the main right hand pane that opens at step 1.
3. Close the Visual Basic window & test.
4. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm).

Code:
Function Fromlc(s As String) As String
  With CreateObject("VBScript.RegExp")
    .Pattern = "[a-z]"
    If .Test(s) Then Fromlc = Mid(s, .Execute(s)(0).FirstIndex + 1)
  End With
End Function


Excel 2016
MN
103263 7 hh
113502U- 10 htht
12445334 11 tt
1335-409 6
143-355P 7 w 1 vw 1 v
15936423 7
16120-PP 9
177-0565 4
18/34303 9 h 1h 1
19P78062 8
2075566F 4 bb
21/34-PU 8 tt
Remove before lower case
Cell Formulas
RangeFormula
N10=Fromlc(M10)
 
Upvote 0
Hi Guys

The formula works great and Peter's function works great. I think I'll use the function for now.

Thanks Eric, Scott and Peter.

All the best

Graham
 
Upvote 0
With a small change to the pattern, you could just pull the first value from the .Execute

Code:
Function Fromlc(s As String) As String
  With CreateObject("VBScript.RegExp")
    .Pattern = "[a-z].*"
    If .Test(s) Then Fromlc = .Execute(s)(0)
  End With
End Function
 
Upvote 0

Forum statistics

Threads
1,215,779
Messages
6,126,846
Members
449,343
Latest member
DEWS2031

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