Numbers - How to find a single quote in a string

So the following function in Excel returns a value of 3:


=FIND("'", A1, 1)


A1 contiains 15' 6"


In Numbers it errors out saying it can't find "'".


It appears Numbers has issues using quotes in FIND (and SEARCH). Any one know how to fix this or is Numbers just busted.

MacBook Pro 15", macOS 10.14

Posted on Jul 9, 2019 11:38 AM

Reply
Question marked as Top-ranking reply

Posted on Jul 9, 2019 5:49 PM

It is most probable the character in your search is not the same character in your string. Apple likes "smart" quotes. Instead of an ASCII code 39 apostrophe, one is probably Unicode 8217.


I turn off smart quotes, mainly for this reason. An "opening single quote" is different from a "closing single quote" and both are different from an actual apostrophe. Same problem with double quotes. Turn it off in Numbers/Preferences/Auto-Correction then re-type the character in your formula or in your string in A1 or both.




6 replies
Question marked as Top-ranking reply

Jul 9, 2019 5:49 PM in response to flyer

It is most probable the character in your search is not the same character in your string. Apple likes "smart" quotes. Instead of an ASCII code 39 apostrophe, one is probably Unicode 8217.


I turn off smart quotes, mainly for this reason. An "opening single quote" is different from a "closing single quote" and both are different from an actual apostrophe. Same problem with double quotes. Turn it off in Numbers/Preferences/Auto-Correction then re-type the character in your formula or in your string in A1 or both.




Jul 9, 2019 8:00 PM in response to flyer

One doesn't have to "suspect" or "guess." Numbers can tell you exactly what that character is.




Formulas in example shown in screenshot:


In B2, filled down:


=CODE(MID(A2,3,1))


In C2, filled down:


=CHAR(B2)


In D2, filled down:


=FIND(C2,A2,1)


And for finding the double-quotes:





Formulas in example shown in screenshot:


In B2, filled down:


=CODE(MID(A2,LEN(A2),1))


In C2, filled down:


=CHAR(B2)


In D2, filled down:


=FIND(C2,A2,1)



If you are searching for a straight double-quote and want to put that directly into a formula you need to "escape" with extra " , like this:


=FIND("""",A2,1)


And to find a curly double-quote, you can do this:


=FIND(CHAR(8221),A3,1)


To me it seems as if FIND is working fine in Numbers.


SG

Jul 9, 2019 5:53 PM in response to flyer

I suspect FIND is looking for a character that is not in cell A1, as in this example:

In Cell B1, the formula shown returns an error.

In Cell B3, searching in A2, the same formula returns 3, a correct result.


Note the differences in content between A1 and A2. These are not format changes; the third and sixth characters are different characters in A1 from those in A2.


Regards,

Barry


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Numbers - How to find a single quote in a string

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.