FIND returning #VALUE! error

Nola111

Board Regular
Joined
Aug 28, 2013
Messages
119
The string in cell A1 is:

Code:
Multi-Specialty - 12254

If I put this formula in B1:

Code:
FIND("-", A1)

It returns 6.

But if I do:

Code:
FIND(" - ",A1)

I get a #VALUE ! error.

Why can't it find that string of space-hyphen-space when FIND can normally find any string of characters? How would I do a FIND for space-hyphen-space?
 
Last edited:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
It maybe that the spaces are not "normal" spaces. Try
=FIND(" - ",SUBSTITUTE(A1,CHAR(160)," "))
 
Upvote 0
are those hardspaces from a download, maybe a different acsii code
 
Upvote 0
It works fine for me. What that tells me is that the spaces around the "-" are probably not regular spaces, but probably special spaces (like non-breaking spaces).
I often see that with data that is downloaded from the Web or comes from other sources.

Assuming that space before the hyphen is in space 16 (as per your example), you can see exactly what is in the space with the following formula:
Code:
=CODE(MID(A1,16,1))
This returns the ASCII code for the value in the 16th space. Then you can use an ASCII table to see what that is: http://www.asciitable.com/
A regular space should return "32". If it returns anything else, it is not a typical space.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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
Back
Top