I think a formula to cover all the possibilities would be pretty complex.
Either you could give more specifics (like always 4 characters with a single
letter either at the beginning or end, but never embedded) and it would make it
easier to write.
But if your text had a bunch of different possible formats 614L 61L4 6L14 l614
or even 123qeqr4562wew and you wanted to extract just the digits (0-9, no
decimal points, no negative signs), then you could use a user defined function
like this:
Option Explicit
Function JustNumbers(rng As Range) As Variant
Dim iCtr As Long
Dim myNumbers As String
Set rng = rng(1)
myNumbers = ""
For iCtr = 1 To Len(rng.Value)
If Mid(rng.Value, iCtr, 1) Like "#" Then
myNumbers = myNumbers & Mid(rng.Value, iCtr, 1)
End If
Next iCtr
JustNumbers = myNumbers
End Function
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)
right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side
Paste the code in there.
Now go back to excel.
Type in some test data into an empty cell (A1?) and then put this in another
cell:
=justNumbers(a1)
And see if it worked.