ISNUMBER returning FALSE with function?

Jconafay

New Member
Joined
Dec 29, 2016
Messages
11
Hello all,

I'm currently trying to extract numbers from a column that is formatted as follows:

Blah Blah For Blahing (0284)

And am using this function which generally works:

=MID(I2, SEARCH("(", I2) + 1, SEARCH(")", I2) - SEARCH("(", I2)-1))

Which works BEAUTIFULLY, EXCEPT in the case of something like this:

Blahdiblah (BDB) (0247)

Which returns the acronym instead of the number.. I thought I came up with a really elegant solution by putting this out there:

=IF(ISNUMBER(MID(I2, SEARCH("(", I2) + 1, SEARCH(")", I2) - SEARCH("(", I2)-1)),MID(I2, SEARCH("(", I2) + 1, SEARCH(")", I2) - SEARCH("(", I2)-1), "WHY?!")

But the ISNUMBER function is returning as false even when I isolate the =ISNUMBER(MID.... etc

Any help on this or anything I'm missing that would make it return false like it is? I'm now realizing that I'll have to do some other magic to skip the text even if this does resolve as TRUE, but I'll get to that?

Thanks in advance!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

bosco_yip

Well-known Member
Joined
Dec 2, 2002
Messages
1,947
Office Version
  1. 2019
Platform
  1. Windows
Try,

=IF(ISNUMBER(0+MID(I2, SEARCH("(", I2) + 1, SEARCH(")", I2) - SEARCH("(", I2)-1)),MID(I2, SEARCH("(", I2) + 1, SEARCH(")", I2) - SEARCH("(", I2)-1), "WHY?!")

Regards
 
Upvote 0

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
Does this work for you?

=SUBSTITUTE(REPLACE(A2,1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")-1),""),")","")
 
Upvote 0

FDibbins

Well-known Member
Joined
Feb 16, 2013
Messages
6,723
Any time you use LEFT, MID or RIGHT, you generate a text answer, even if it looks like a number - so you need to convert the answer to a number...

--MID(I2, SEARCH("(", I2) + 1, SEARCH(")", I2) - SEARCH("(", I2)-1))
MID(I2, SEARCH("(", I2) + 1, SEARCH(")", I2) - SEARCH("(", I2)-1))*1
MID(I2, SEARCH("(", I2) + 1, SEARCH(")", I2) - SEARCH("(", I2)-1))+0
 
Upvote 0

Jconafay

New Member
Joined
Dec 29, 2016
Messages
11
I ended throwing a simple *1 in at the end. Thank you, it worked! Now to tackle the problem of only returning the numbers..
 
Upvote 0

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,801
... I'm currently trying to extract numbers from a column that is formatted as follows:

Blah Blah For Blahing (0284)
If your bracketed numbers are always at the end of the string and always have four digits, see if the following formula works for you:

=--LEFT(RIGHT(I2,5),4)
 
Upvote 0

Jconafay

New Member
Joined
Dec 29, 2016
Messages
11
This 100% worked, thank you so much, didn't see it before and thank you everyone for the quick replies! Very much appreciated.
 
Upvote 0

Forum statistics

Threads
1,191,584
Messages
5,987,492
Members
440,097
Latest member
Wint

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
Top