Excel file - word search in cell with spotlight.

I have an excel file on the desktop.

I have product codes inside the excel file.

When I do a product code search with Spotlight, I want it to search within this excel file. But it doesn't!


The old system does this search in leopard. But it doesn't on new systems. Anyone know your reason?

Posted on Jan 27, 2022 1:53 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 27, 2022 5:05 AM

Spotlight assumes that with the unescaped minus sign, you want it to perform a subtraction, not a find of that string. Instead, narrow your search results by using:


kind:excel "35-20304143"



In this manner, you won't be asking Spotlight to search *all* filenames and their contents for that string, and focus it on just Excel files.

9 replies
Question marked as Top-ranking reply

Jan 27, 2022 5:05 AM in response to RealX11

Spotlight assumes that with the unescaped minus sign, you want it to perform a subtraction, not a find of that string. Instead, narrow your search results by using:


kind:excel "35-20304143"



In this manner, you won't be asking Spotlight to search *all* filenames and their contents for that string, and focus it on just Excel files.

Jan 27, 2022 8:33 AM in response to RealX11

In System Preferences > Spotlight > Search Results, do you have Spreadsheets selected? That is key to indexing spreadsheets. You did not follow my instructions by double-quoting the string to be found in the Excel document.


I have an Excel .xlsx file on my Desktop and using the earlier syntax that I provided, I can identify the specific Excel document with that text string. I also just created another spreadsheet with your number examples, and Spotlight immediately found the document.




Feb 22, 2022 9:24 AM in response to Alienwise

I do not have Excel installed to test this further. I do have LibreOffice 7.3, and using its Calc spreadsheet, I can set the format of one cell to text and another cell to general number.



As soon as I save this as an Excel 2007 - 365 .xlsx format, I can use Spotlight to find this specific .xlsx document using the following variety of Spotlight queries:


kind:excel 123
kind:excel 35
kind:excel "35-"



macOS 11.6.4

Feb 22, 2022 7:14 AM in response to VikingOSX

Let me ask a question: Spotlight/Finder is not able to search for numbers (fields which have a number format) in Excel?


If a put a number in a Excel field - such as "125" - Spotlight won't find it, even if I format it as "Text" within Excel app. However, if I modify the same field content to "125a", Spotlight will index (therefore it will be able to find it).


Is that so? If Spotlight cannot be taught to find those numbers in a number format, is there a workaround (some kind of macro to have Excel create text strings based on those numbers)?

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.

Excel file - word search in cell with spotlight.

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