Dear Members,
I want to apply the following formula in Cell C2 containing AOJPB6685H
=ISNUMBER(MID(C2,6,4)) which resulting in False. While i think that result (6685) should be as True. Can anyone help why excel does not recognize 6685 as number.
Dear Members,
I want to apply the following formula in Cell C2 containing AOJPB6685H
=ISNUMBER(MID(C2,6,4)) which resulting in False. While i think that result (6685) should be as True. Can anyone help why excel does not recognize 6685 as number.
Because the cell contains text, not a mixture of text and numbers.
Try this:
=VALUE(MID(C2,6,4))
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
or
=ISNUMBER(MID(C2,6,4)*1)
Thanks for the replies
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
No, the true reason is:Originally Posted by AliGW
because MID returns text
(even if the entire cell is digits).
As @Pat and only Pat mentions, MID is a text function. Like all text functions, wait for it...it returns text, even if the string is all numeric. ISNUMBER fails because the result returned by MID, despite being all numeric digits, has returned them as text.
As others have pointed out, conversion will need to take place to convert the result to a numeric value. One method is *1 (as any number times 1 is the same number, and Excel is smart enough to know you cant multiply text so it attempts to treat the text as a number. If its all numeric digits then multiplication is possible with the result being a number). Another method is using the VALUE function or the N function. I believe the difference being the VALUE function can convert a wider range of numbers to a wider range of output (like dates, times, etc), however I would imagine for decimal values and integers that N is more efficient.
Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.
"I am here to help, not do it for people" -Me
This works fine where the inspected string -- MID(C2,6,4) -- is indeed a number,
but fails in the other case --
try C2 e.g. as 12345678x0 and you get #VALUE!
davsth got it right, use one of these --
Please Login or Register to view this content.
Last edited by Pat and only Pat; 06-29-2018 at 04:11 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks