Excel SEARCH Function: Syntax, Examples, and Real Use Cases
Excel SEARCH function explained. Learn syntax, wildcards, and how to combine SEARCH with IF, MID, and IFERROR with real worksheet examples.

The Excel SEARCH function tells you where one piece of text starts inside another piece of text. That sounds simple. The real power shows up the moment your data has inconsistent capitalization, embedded codes, free-form notes, or anything else that breaks a straight lookup. SEARCH returns a number. That number is the character position where your target text first appears. You then feed that number into MID, LEFT, or IF to pull out the part of the string you actually want.
Most people meet SEARCH after they have hit a wall with VLOOKUP. VLOOKUP needs an exact match in a single column. SEARCH works inside a single cell, picking out a substring no matter where it lives. The two tools are not competitors. They solve different problems.
When you have to clean up customer names dumped from a CRM, parse product codes embedded in descriptions, or flag rows that mention a specific term, SEARCH is the workhorse you reach for first. And unlike its close cousin FIND, SEARCH is case-insensitive and supports wildcards, which is a big deal when your source data is messy.
This guide walks you through the SEARCH function from the basic syntax to the patterns that experienced analysts use every day. You will see how to combine SEARCH with IFERROR so it does not blow up when the target text is missing, how to use the start_num argument to skip past the first occurrence, and how wildcards let you match patterns instead of literal strings. By the end you will have a working mental model and a handful of formulas you can paste into your own workbook on Monday morning.
Excel SEARCH Function At a Glance
Two quirks deserve attention before you write your first formula. First, SEARCH counts from 1, not 0. If your target text starts in the very first character of the cell, SEARCH returns 1. Programmers who switch over from Python or JavaScript trip on this constantly. Excel has its own counting habits and you have to follow them.
Second, SEARCH returns the position of the first character of the match, not the position right after the match. If you want to extract everything after a separator, you have to add the length of the separator to your result. We will work through examples that show that math clearly so it does not feel like guesswork.
The third argument, start_num, is optional but extremely useful. It tells SEARCH where to begin looking inside the within_text. Set it to 5 and SEARCH ignores the first four characters and starts hunting from position 5. That single argument unlocks the ability to find the second, third, or nth occurrence of a substring by chaining SEARCH calls together. We will get to that in the advanced examples below.

SEARCH is case-insensitive and accepts wildcards. FIND is case-sensitive and does not accept wildcards. Use SEARCH for forgiving matches on messy text. Use FIND when you need to distinguish between Apple and apple, or when a literal asterisk or question mark appears in your data. Both functions have the same three arguments and both return a character position number when the match succeeds.
That distinction matters more than it looks. If you are searching for the word Order inside a column of email subject lines and some users typed ORDER, some typed Order, and some typed order, FIND only catches the exact capitalization you asked for. SEARCH catches all three with one formula. For most business data, SEARCH is the safer default. Save FIND for situations where you genuinely need the case sensitivity.
The wildcard difference is just as important. SEARCH accepts the asterisk for any sequence of characters and the question mark for any single character. So SEARCH("a*c", "abc") returns 1 because abc fits the pattern a-anything-c. If you need to find a literal asterisk inside your text, escape it with a tilde, like ~*. FIND does not interpret wildcards, so if you pass an asterisk to FIND it looks for a literal asterisk. Knowing which function to grab for which job saves a lot of head-scratching later.
One more thing worth mentioning here. SEARCH is volatile in the sense that it recalculates whenever the workbook recalculates, but it is not a heavy formula. You can drop tens of thousands of SEARCH calls into a column without seeing performance problems on a modern machine. If you do hit speed issues, it is almost always because you wrapped SEARCH inside another expensive function, not because SEARCH itself is slow. Profile before you blame.
The Three Arguments of SEARCH
The text or wildcard pattern you are looking for. Can be a literal string in quotes, a cell reference, or another formula that returns text. Empty quotes return position 1 by convention.
The text being searched. Usually a cell reference to the messy data you are parsing. SEARCH starts at position 1 unless you override that with start_num.
The character position where SEARCH begins. Defaults to 1. Use this to find a second or later occurrence of the same substring by chaining SEARCH calls together.
An asterisk matches any sequence of characters including none. A question mark matches exactly one character. Use tilde then asterisk or tilde then question mark to match those literal symbols.
Lowercase and uppercase letters are treated as identical. This is the main reason analysts choose SEARCH over FIND for general-purpose text parsing on user-entered data.
When the find_text does not appear inside the within_text, SEARCH returns the VALUE error. Wrap calls in IFERROR if your downstream formula cannot handle errors.
The first real-world pattern most people learn is checking whether a substring exists. You do not actually care about the position number, you just want a yes or no answer. Combine SEARCH with ISNUMBER to get that. The formula =ISNUMBER(SEARCH("urgent", A2)) returns TRUE when the word urgent appears anywhere in A2, regardless of case. Wrap that in IF to flag the row, conditional format the cell, or feed it into a filter. This pattern shows up constantly in support ticket triage, content moderation queues, and email parsing pipelines.
The second pattern is extracting a substring after a known separator. Suppose column A contains values like 2026-Q3-Marketing, and you want everything after the second hyphen. The formula =MID(A2, SEARCH("-", A2, SEARCH("-", A2)+1)+1, 100) does the job. The inner SEARCH finds the first hyphen. The outer SEARCH starts one character past that and finds the second hyphen. MID then grabs 100 characters starting one position after the second hyphen, which gives you Marketing. This is the kind of formula that looks intimidating until you read it from the inside out, at which point it makes sense.
Common SEARCH Function Patterns
The simplest use is checking whether a word exists in a cell. =ISNUMBER(SEARCH("refund", B2)) returns TRUE if the word refund appears anywhere in B2. Use this inside IF for conditional flagging, inside SUMPRODUCT for counting matches across a range, or inside conditional formatting rules to highlight rows.

The error-handling pattern in the last tab is more important than it looks. If you build a dashboard or pivot that depends on SEARCH results and even one cell returns VALUE, the whole formula chain can break. IFERROR is your seatbelt. Get in the habit of writing every SEARCH call inside an IFERROR wrapper, even during prototyping. It costs you nothing and prevents the silent failures that turn into Friday afternoon support tickets.
The nth occurrence trick is the one that separates beginner SEARCH users from people who actually leverage the function. The mechanism is simple once you see it written out. SEARCH takes a start_num argument. You feed it the position of the first occurrence plus one, and SEARCH skips past that and finds the next one.
Chain three SEARCH calls and you have the third occurrence. The technique scales to any depth, although at four or five levels the formula starts to get hard to read and you should consider switching to a helper column or a TEXTSPLIT formula in newer versions of Excel.
Wildcards are the third big lever. The asterisk is greedy, which means it will match as many characters as possible. =SEARCH("a*z", "amazingrz") returns 1 because the asterisk eats everything from a through r and lets z close the pattern. The question mark is the opposite. It matches exactly one character, no more and no less. =SEARCH("b?t", "bat") returns 1. =SEARCH("b?t", "boot") returns the VALUE error because boot has two characters between b and t, not one. If you need to match more than one character but a specific count, you stack question marks. Two question marks match exactly two characters.
If your source data contains literal asterisks, question marks, or tildes, you must escape them. Use tilde-asterisk to match a real asterisk, tilde-question to match a real question mark, and tilde-tilde to match a real tilde. Forgetting to escape produces silent wrong-match bugs that are painful to debug because the formula does not error out. It just returns a different position than you expected. Always test with sample data that includes wildcards if your real data has them.
Escape characters are one of those topics that feels academic until it bites you. Imagine you are parsing customer comments and some of them include phrases like Rated five stars *highly recommend*. Your SEARCH for the asterisk is going to match against the wildcard interpretation first, returning 1 or some other unexpected position. The fix is to write =SEARCH("~*", A2) with a tilde in front, telling Excel you want a literal asterisk. It takes one keystroke and saves an afternoon of confusion.
The tilde escape applies to all three wildcard characters. Tilde-asterisk for asterisk, tilde-question for question mark, tilde-tilde for tilde itself. The order matters. The tilde always comes before the character you are escaping, not after. If you ever need to feed a SEARCH formula a dynamic value that might contain wildcards, you can use SUBSTITUTE to escape them at runtime, although that pattern is rare enough that most analysts handle it case by case.
One pattern I see new users miss is using SEARCH to validate input. You can wrap SEARCH inside a conditional formatting rule or a data validation rule to flag cells that contain banned terms, missing separators, or wrong-format codes. For example, if every product code in your column should contain a dash, you can apply a conditional format with the formula =NOT(ISNUMBER(SEARCH("-",A2))) that highlights any cell missing the dash. The visual feedback catches data entry errors at the moment they happen rather than weeks later when a report breaks.
SEARCH Function Best Practices
- ✓Wrap every SEARCH call in IFERROR to handle missing matches gracefully
- ✓Use SEARCH for case-insensitive matches and FIND when case matters
- ✓Add one to your SEARCH result before using it in MID if you want to skip the separator itself
- ✓Test wildcard formulas with edge-case data including empty strings and exact matches
- ✓Escape literal asterisks, question marks, and tildes with a leading tilde character
- ✓Chain SEARCH calls with start_num to find second and later occurrences without helper columns
- ✓Combine SEARCH with ISNUMBER for simple yes-or-no existence checks across large ranges
- ✓Profile your workbook if SEARCH performance feels slow, the issue is usually the wrapping function
- ✓Use a helper column when a formula has more than three nested SEARCH calls for readability
- ✓Document any non-obvious wildcard patterns in a comment so future maintainers understand intent
The single biggest mistake I see in real workbooks is forgetting that SEARCH returns the position of the first character of the match. If your separator is more than one character long, you have to do extra math. For example, searching for the string ::DONE:: inside log data returns the position of the first colon.
To extract everything after the marker, you need to add the length of the marker to your starting position. The formula =MID(A2, SEARCH("::DONE::", A2) + LEN("::DONE::"), 1000) does this cleanly. Hard-coding the number 8 instead of LEN works but breaks the moment someone changes the marker.
Another subtle issue is the way SEARCH treats spaces. A trailing space in your find_text can cause matches to fail in confusing ways because the data has the substring but no trailing space. TRIM both the find_text and the within_text if you are not sure about whitespace hygiene. Better yet, run TRIM and CLEAN on your source data as a preprocessing step so SEARCH does not have to fight invisible characters. Excel has plenty of ways to leave hidden non-breaking spaces in your data, especially when content comes in from web scrapes or copy-paste operations.
For longer text, performance can matter. SEARCH is generally fast, but if you are running it across hundreds of thousands of rows with several nested calls per cell, you might see Excel slow down on recalculation. The standard fixes are to convert formulas to values where possible, use helper columns to break complex formulas into stages, or move the parsing logic to Power Query which handles large data sets more efficiently. None of those changes the logic of SEARCH itself, just the framework it operates inside.

When to Reach for SEARCH
- +Case-insensitive matching works on messy user-entered data without preprocessing
- +Wildcard support enables flexible pattern matching with simple syntax
- +Optional start_num argument unlocks nth-occurrence parsing through chaining
- +Available in every Excel version from 2007 forward and Excel for the web
- +Combines naturally with MID, LEFT, RIGHT, IF, and IFERROR for full text parsing
- +Lightweight and fast across tens of thousands of rows on typical hardware
- −Cannot distinguish between uppercase and lowercase variants when case matters
- −Returns VALUE error on no match, requiring IFERROR wrappers in most production formulas
- −Wildcard interpretation can cause silent bugs when source data contains literal asterisks or question marks
- −Nested SEARCH calls become hard to read past three levels of depth
- −Returns only the first match position, requiring chains or helper columns for later occurrences
- −Cannot return all matches in one call, unlike newer functions such as TEXTSPLIT or REGEX in Excel 365
The case-sensitivity limitation is the most common reason analysts switch from SEARCH to FIND mid-project. If your data uses code formats where capitalization is meaningful, like Sku abc-123 being different from SKU ABC-123, you must use FIND. SEARCH will happily match either form and give you results that look right but miss the intended filter. The safest workaround is to commit to one or the other up front based on whether case carries meaning in your specific data set. Mixing them inside a single workbook is fine, just be deliberate about which one you choose for each formula.
The single-match limitation also frustrates power users. SEARCH cannot tell you how many times a substring appears, only where the first one is. To count occurrences, you have to combine LEN and SUBSTITUTE in a clever way. The formula =(LEN(A2) - LEN(SUBSTITUTE(LOWER(A2), "target", ""))) / LEN("target") returns the count of times target appears in A2, case-insensitive. It works by removing all instances and dividing the length difference by the length of the target. The LOWER call inside SUBSTITUTE matches the case-insensitive behavior of SEARCH itself.
If you have Excel 365, the new TEXTSPLIT and TEXTBEFORE functions handle many of these patterns more cleanly. TEXTBEFORE returns everything before a specified delimiter, which replaces a common LEFT plus SEARCH combination. TEXTSPLIT breaks a string into multiple cells based on a delimiter, which replaces several nested SEARCH calls for parsing structured data. Both are case-insensitive by default but accept an argument to flip that. They do not replace SEARCH for ad-hoc lookups, but they should be your first reach for cleaner parsing logic when you have access to them.
SEARCH Function Quick Stats
One pattern that deserves more space is using SEARCH inside SUMPRODUCT to count rows that contain a target phrase. The formula =SUMPRODUCT(--ISNUMBER(SEARCH("refund", A2:A1000))) returns the number of cells in that range where the word refund appears anywhere. The double negative converts TRUE and FALSE to 1 and 0 so SUMPRODUCT can add them up. This works across thousands of rows without volatile recalculation issues.
It is also one of the cleanest ways to build a quick dashboard widget that tells you how many open tickets mention a particular product line or how many comments reference a specific feature request. Pair it with a dynamic input cell and you have an interactive counter that updates as the analyst types.
SEARCH also works well with conditional column-level helper formulas in tables. Convert your data to an Excel table first, then add a column with a formula like =IFERROR(IF(SEARCH("vip", [@Notes])>0, "Priority", "Standard"), "Standard"). The table autofills the formula down every new row, so as your team adds tickets the priority flag stays current without manual copy-paste.
EXCEL Questions and Answers
SEARCH belongs in every analyst's core toolkit because it solves the messy-string problems that VLOOKUP and INDEX cannot touch. Once you internalize the three-argument structure and the wildcard behavior, you can write formulas that handle real-world data without breaking on the first edge case. The patterns in this guide cover roughly 90% of the situations I have seen in production workbooks across a wide range of industries. The remaining 10% usually call for Power Query or for the newer Excel 365 text functions, which build on the same conceptual foundation that SEARCH established.
If you remember nothing else from this guide, remember three things. First, always wrap SEARCH in IFERROR unless you have a specific reason to let errors bubble up. Second, choose between SEARCH and FIND based on whether case matters in your data, and document that choice somewhere a future maintainer can find.
Third, when your nested SEARCH calls hit three or four levels of depth, stop and build a helper column. Readability is a feature. A formula that another analyst can understand in 30 seconds is worth more than a formula that fits on one line but requires a coffee break to decode.
Practice with the quiz linked above to lock in the syntax. Many people learn SEARCH well enough to use it but forget the optional start_num argument exists until they hit a problem that requires it. Spaced practice with realistic example data is the fastest way to make the function automatic. Build a sample workbook with messy customer data, throw a dozen SEARCH formulas at it, and see what happens when the data does not cooperate. Every time the formula breaks, you learn something the documentation does not tell you.
Excel as a platform has been adding more powerful text functions every year. REGEXEXTRACT, TEXTSPLIT, TEXTBEFORE, and TEXTAFTER are all worth learning if you have access to Excel 365 or the web version. They do not replace SEARCH, but they let you express common parsing intentions with less syntactic noise.
The mental model you build from mastering SEARCH transfers directly to all of them, which is another reason this function is a great starting point. Spend an afternoon writing 20 different SEARCH formulas against real data and you will see immediate improvement in your day-to-day workbook work. The investment pays back the first time a colleague hands you a column of dirty text and asks if you can clean it up by lunch.
About the Author
Attorney & Bar Exam Preparation Specialist
Yale Law SchoolJames R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.