Learning Partial String Matching in Excel: A Step-by-Step Guide


Introduction to Partial String Matching in Excel

Identifying a partial match between disparate datasets is a foundational requirement for effective data analysis and cleaning tasks within Excel. Unlike simple exact matches, which necessitate character-for-character alignment between two cells, partial matching grants analysts the crucial ability to locate instances where one complete string of text is contained as a substring within another, regardless of any preceding or trailing characters. This powerful capability proves invaluable when confronting common data inconsistencies, such as inconsistent abbreviations, minor data entry errors or typos, or discrepancies arising from varying levels of descriptive detail (for instance, successfully linking “Inc.” to “Incorporated,” or matching “Apple” to “Apple Inc.”). By mastering this technique, analysts can significantly enhance their data reconciliation efficiency and ensure robust data integrity across multiple sources.

The most standard and highly reliable methodology for executing partial string matching involves the strategic combination of several potent Excel functions. Primarily, this technique relies on the widely used VLOOKUP function, which is then manipulated using special characters known as wildcards. The central hurdle in partial matching is instructing Excel to search for a flexible pattern—a text fragment—rather than insisting on an identical, specific value. By carefully structuring the search criteria, we can efficiently scan a large, primary range of cells (Column A) using potentially shorter or less precise values from a separate column (Column B). The goal is either to return corresponding data or simply to flag the existence of the match. This inventive method transforms a typically restrictive lookup function into a remarkably flexible and essential data auditing tool.

The following syntax represents a robust and professional approach for finding partial matches between two columns. This sophisticated formula is not only designed to perform the lookup effectively but also to gracefully manage any potential errors that arise, thereby ensuring a clean, professional output in your spreadsheet without the visual clutter of error codes:

=IFERROR(VLOOKUP("*"&B2&"*", $A$2:$A$9, 1, 0), "")

This specific configuration is meticulously engineered to check whether the value found in cell B2 exists as a substring anywhere within the designated lookup range, which is fixed as $A$2:$A$9. If the system successfully identifies a partial match, the formula is instructed to return the corresponding value that it found from the range A2:A9. Conversely, if the search yields no match, the critical inclusion of the IFERROR function ensures that a clean blank cell (represented by the empty string "") is returned. This powerful error handling mechanism prevents your spreadsheet from being overwhelmed by standard, distracting error messages such as #N/A, leading to clearer data presentation.

Deconstructing the Core Formula: VLOOKUP and Wildcards

To truly harness the power and adaptability inherent in this technique, it is essential to systematically deconstruct the individual components of the core formula: =IFERROR(VLOOKUP("*"&B2&"*", $A$2:$A$9, 1, 0), ""). Every function, operator, and character within this structure plays a decisive role in enabling the partial match functionality and controlling the resultant output. A clear understanding of these parts empowers users to adapt the formula effectively for a variety of complex data scenarios that extend far beyond a simple two-column check, affording greater control over how data is queried and ultimately presented.

The primary engine driving this lookup operation is the VLOOKUP function itself. Typically, VLOOKUP strictly requires that the lookup_value argument corresponds to an exact match in the lookup column. However, we cleverly bypass this restriction by strategically manipulating this argument: we concatenate the desired search term (derived from cell B2) with the powerful wildcards. The resulting structure, "*"&B2&"*", explicitly instructs Excel to search for any string that fully contains the content of B2, regardless of whatever characters or phrases might precede or follow it within the target cell. The asterisk (*) serves as the critical wildcard, acting as a flexible placeholder for any sequence of zero or more characters. This essential inclusion transforms the inherently strict exact-match requirement of VLOOKUP into a flexible and powerful partial match query.

Furthermore, we utilize the ampersand (&) operator, which is the standard symbol for concatenation in Excel. This operator serves to merge the text string representing the leading wildcard ("*"), the variable content of the target cell (B2), and the text string for the trailing wildcard ("*"). This process successfully creates a single, dynamic lookup value that VLOOKUP can process. For instance, if B2 contains the text “Spurs,” the resulting lookup value generated becomes *Spurs*. The range $A$2:$A$9 is designated as the table_array, secured using absolute references (the dollar signs, $) to guarantee that when the formula is efficiently dragged down or copied across other cells, the critical lookup range remains constant. This fixation is paramount for preventing systemic errors. The final two arguments, 1 (column index) and 0 (exact match requirement), instruct VLOOKUP to return the value from the first column of the range and perform an exact match on the specific pattern generated by the wildcards.

Finally, the entire lookup operation is encased within the protective structure of the IFERROR function. When VLOOKUP fails to find a match—even a partial one utilizing wildcards—it standardly returns the raw #N/A error code. IFERROR acts as an interceptor; if the VLOOKUP returns an error, IFERROR executes its second argument, which is specified here as an empty string (""). This mechanism is incredibly beneficial for generating professional reports where raw error messages would be distracting or misleading. It ensures that only positive, confirmed results or clearly indicated blanks (signifying a non-match) are displayed to the user.

Step-by-Step Implementation: The Basketball Data Example

To vividly illustrate the practical application of this powerful partial match technique, we will employ a clear example involving basketball team names. Imagine we have two distinct columns of data in Excel: Column A contains the full, officially recognized names of various basketball teams, while Column B contains potentially abbreviated, shortened, or variant names. Our primary objective is to accurately determine which of the abbreviated names listed in Column B can be successfully matched to a corresponding full name found within Column A.

Examine the following initial dataset setup, which clearly separates the full names (Column A) from the abbreviated or variant terms (Column B):

Our task is to populate Column C, which we will title “Full Match Found,” by systematically checking if each team name listed in the abbreviated column (B) exists as a partial component within any entry in the full team name column (A). This process requires setting up the formula precisely in the first result cell. To initiate this process, we must input the formula directly into cell C2, targeting the first entry in Column B (which is B2).

We will carefully type the following formula into cell C2 to perform the partial match lookup:

=IFERROR(VLOOKUP("*"&B2&"*", $A$2:$A$9, 1, 0), "")

After entering this formula into C2 and confirming the initial calculation, the resulting value will indicate whether the abbreviated name in B2 (“Rockets”) was successfully found as a partial match within the full list A2:A9. Crucially, the use of absolute references ($A$2:$A$9) ensures that the lookup range remains fixed and unmoving as we proceed. Once the initial calculation in C2 is verified, we can then efficiently replicate this operation across the entire dataset. The subsequent step involves utilizing the fill handle—the small square located at the bottom-right corner of cell C2—to click and drag the formula downwards. This action systematically applies the formula to every remaining cell in Column C, automatically adjusting the relative reference (B2 will correctly change to B3, B4, and so on) while rigorously maintaining the absolute reference for the lookup range (A2:A9). This systematic application allows for a rapid and comprehensive analysis of all entries in the abbreviated list against the full list.

Excel partial match with two columns

Interpreting the Results and Handling Non-Matches

Upon the successful application of the formula across the entire dataset in Column C, the results provide an immediate and clear delineation of the relationship between the abbreviated team names in Column B and the full team names in Column A. The resulting output in Column C will either display the corresponding full team name from Column A, which unequivocally signals a successful partial match, or it will display a clean, blank cell, which indicates that absolutely no match was found for that specific abbreviated entry. This dual output mechanism provides immediate, actionable insights into data completeness and consistency, significantly streamlining the overall data validation process.

When a partial match is confirmed—meaning the text in Column B is successfully located as a substring within an entry in Column A—the VLOOKUP function executes successfully. Because VLOOKUP is instructed to return the value from the first column of the lookup range (Column A), the corresponding full team name is accurately displayed in Column C. For example, when the formula checks B2 (“Rockets”), it dynamically constructs the search pattern *Rockets*. This pattern successfully matches “Houston Rockets” in Column A, and consequently, “Houston Rockets” is returned to C2. This demonstrates the superior efficiency gained by using wildcards to effectively bridge the gap between differing data formats.

Conversely, if the abbreviated name provided in Column B does not appear as a substring within any of the entries in the lookup range (A2:A9), the VLOOKUP function fails internally and generates the standard #N/A error. This is the precise point where the protective measure of the IFERROR function becomes critically important. Instead of displaying the raw error code, IFERROR traps the error and returns the designated empty string (""). This results in a clean, blank cell, which clearly and non-disruptively indicates the confirmed absence of a partial match.

Reviewing the specific outcomes derived from the basketball example provides concrete confirmation of the formula’s consistent behavior across the entire dataset:

  • The term “Rockets” in Column B successfully generated a partial match with “Houston Rockets” in Column A, which was consequently returned to Column C.
  • Similarly, the input “Spurs” resulted in a successful partial match with “San Antonio Spurs,” confirming efficient data reconciliation.
  • However, the entry “Lakers” did not find a partial match within the available list (A2:A9), leading the IFERROR function to return a clean blank cell.

This logic is applied consistently to every cell down the column, ensuring accurate flagging of matches and non-matches.

Important Considerations and Inherent Limitations

While the combination of VLOOKUP and wildcards offers a highly effective and swift method for finding partial matches, users must remain acutely aware of certain inherent limitations and necessary precautions to ensure the accuracy and reliability of their results, especially in complex environments. Understanding these nuances is crucial for applying this technique correctly in diverse data environments within Excel, particularly when managing large or highly intricate datasets.

One critical consideration relates directly to the case-insensitivity of the standard VLOOKUP function. By default, Excel treats lowercase and uppercase characters as identical when executing lookups. If your specific partial matching process requires strict case sensitivity—for instance, requiring a distinction between “code” and “CODE”—the VLOOKUP/wildcard method alone will be insufficient. For such stringent requirements, users would need to pivot to employing more complex array formulas. These typically involve combining functions like FIND (which is case-sensitive) or EXACT with INDEX and MATCH. While this approach significantly increases formula complexity, it provides the necessary granular control over character matching required for sensitive data validation.

Another major limitation stems from VLOOKUP’s fundamental design constraint: it is engineered only to return the very first match it encounters in the lookup range. In scenarios where a single abbreviated term in Column B could potentially match multiple different entries in Column A, VLOOKUP will cease searching immediately after finding the first valid partial match and return only that corresponding value. For example, if Column A contained both “New York Knicks” and “Knicks Fan Club,” and Column B searched for “Knicks,” VLOOKUP would return whichever entry appears higher (first) in the A2:A9 range. If the objective is to comprehensively identify ALL possible partial matches for a given term, this VLOOKUP method is inherently inadequate, necessitating the use of more advanced techniques such as specialized VBA scripting or the comprehensive data modeling tools available in Power Query to extract a full set of results.

Furthermore, the directionality of the lookup is a key constraint. The VLOOKUP function is strictly limited to searching the leftmost column of the specified table_array. In our primary example, we are searching within Column A and returning a result from Column A (index 1), so this constraint is benign. However, if your data structure required you to search for partial matches in Column B and return a value from Column C, you would need to reorganize the columns to ensure Column B is the first column in your specified range, or, more commonly, employ the much more flexible INDEX and MATCH combination to overcome VLOOKUP’s directional constraints entirely, offering a robust and superior alternative for complex spreadsheet structures.

Advanced Alternatives to VLOOKUP for Data Matching

While the VLOOKUP function combined with wildcards is a standard and reliable method, several other powerful tools and function combinations exist within Excel that are capable of handling partial matching. These alternatives often provide greater flexibility, particularly when dealing with massive datasets or navigating complex conditional logic. These advanced methods are frequently preferred by expert users or those dealing with non-standard data structures that fundamentally challenge the limitations of the standard lookup methodology.

One highly flexible alternative that readily replaces VLOOKUP is the combination of the INDEX and MATCH functions. This pairing is superior because it completely removes the restrictive requirement that the lookup column must be the leftmost column of the range. For partial matching, the MATCH function is combined with the concatenation of wildcards (e.g., "*"&B2&"*") and setting the match type to 0 (exact match on the wildcard pattern). This combination, often used as an array formula (dynamically in modern Excel or entered using Ctrl+Shift+Enter in older versions), implements the same partial match logic but allows the return column (specified by INDEX) to be entirely independent of the lookup column (specified by MATCH), offering far superior structural flexibility across complex sheets.

For data analysts who routinely deal with complex and messy matching scenarios, Power Query (also branded as Get & Transform Data) offers a robust, declarative, and non-formulaic solution integrated directly within Excel. Power Query enables users to efficiently merge two tables based on advanced fuzzy matching logic. This capability extends far beyond simple substring matching, as it can intelligently account for spelling variations, character transpositions, and phonetic similarities between entries. This feature is particularly useful when cleaning highly inconsistent, user-generated data where inconsistencies are rampant. While Power Query may necessitate a steeper initial learning curve than simple formula entry, it provides the critical advantage of creating documented, reproducible data cleanup steps that are easily refreshed and updated whenever the underlying source data changes.

Finally, for users requiring the highest performance, or for implementing complex conditional logic that involves finding multiple matches or executing unique actions based on the match result, Visual Basic for Applications (VBA) remains the ultimate customization tool. A custom VBA function can be written to iterate precisely through cells, utilize dedicated string manipulation functions (such as InStr) to check for substrings, and return custom outputs or dynamically populate lists of all matches found. This method entirely bypasses the inherent limitations of built-in spreadsheet functions like VLOOKUP and IFERROR, providing complete programmatic control over the matching process.

Conclusion and Summary

The strategic application of the VLOOKUP function, critically enhanced by the incorporation of wildcards, provides a highly effective and foundational method for performing partial matching between two columns in Excel. This technique is indispensable for routine data cleaning, reconciliation, and validation tasks, allowing analysts to quickly and accurately identify related records despite common variations in formatting or naming conventions. By encapsulating this core logic within the protective layer of the IFERROR function, the resulting spreadsheet maintains a high degree of professionalism and readability, displaying only positive, meaningful results or deliberate blank cells where no match exists.

While this specific VLOOKUP method is excellent for simple, single-match requirements, users are strongly encouraged to explore and master alternative methods. These include the flexible INDEX/MATCH combination, which overcomes directional limitations, or the highly sophisticated fuzzy matching capabilities offered by Power Query. Mastery of these various techniques ensures that you are fully equipped to handle virtually any data matching challenge, regardless of its complexity or scale, presented in your daily analytical workflow.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

Cite this article

Mohammed looti (2025). Learning Partial String Matching in Excel: A Step-by-Step Guide. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/excel-find-partial-match-in-two-columns/

Mohammed looti. "Learning Partial String Matching in Excel: A Step-by-Step Guide." PSYCHOLOGICAL STATISTICS, 9 Nov. 2025, https://statistics.arabpsychology.com/excel-find-partial-match-in-two-columns/.

Mohammed looti. "Learning Partial String Matching in Excel: A Step-by-Step Guide." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/excel-find-partial-match-in-two-columns/.

Mohammed looti (2025) 'Learning Partial String Matching in Excel: A Step-by-Step Guide', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/excel-find-partial-match-in-two-columns/.

[1] Mohammed looti, "Learning Partial String Matching in Excel: A Step-by-Step Guide," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, November, 2025.

Mohammed looti. Learning Partial String Matching in Excel: A Step-by-Step Guide. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.

Download Post (.PDF)
Scroll to Top