I have to find out if my cells text is a numeric value and wanted to use an elegant non VBA method that doesn't impede on its current state or value.
What I've found is that the ISNUMBER()
function only works if the cells are number formatting or has no spaces if text formatting e.g.:
For the first three I've used =ISNUMBER(...)
and my last attempt is =ISNUMBER(TRIM(...))
.
The only method I've used that doesn't use VBA is to override my current values using text to columns then use the =ISNUMBER()
function.
Note: I am proficient with VBA and Excel and understand I could create a user-defined function. But I don't want to as this imposes a macro required workbook or an add-in to be installed, which I can and have done in some cases.
I will appreciate any advice, thoughts (even if they tell me it can't be done) or VBA solutions (won’t be marked as answer however).
Answer
Try multiplying the cell value by 1, and then running the IsNumber
and Trim
functions, e.g.,:
=IsNumber(Trim(A1)*1)
No comments:
Post a Comment