How would I extract all the numbers from a cell, so for example A1 cell contains: "AA59" I would like the formula to extract 59 and ignore AA. I can use =if(right(A1),2) formula but if A1 contains value AA5 then it will select last two characters (which is A5), so this is wrong?
相关问题
- Excel sunburst chart: Some labels missing
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
- DoCmd.TransferSpreadsheet is not recognizing works
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
- How to create a hyperlink to a different Excel she
If you are always trying to get a single or double digit number from the end of the string try this version:
=LOOKUP(100,RIGHT(A2,{1,2})+0)
Here is a native worksheet formula solution. It's a little inelegant compared to a VBA user-defined-function, but is a standard (non-array) formula and looks more complex than it actually is.
The formula in B21 is,
Fill down as necessary. Wrap the whole thing in a
VALUE(...)
function or precedeMID
with a double unary (aka double minus or --) to convert the text to a true number.As an alternative, consider the Array Formula:
to extract digits from a mixed cell:
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.
try this macro