search
HomeTopicsexcel[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

Most of the time we need to perform precise searches, but there are also times when fuzzy searches are needed. For example, searching for the full name based on the abbreviation, or classifying the name based on numerical values, etc. Fuzzy search is not the same as a blind man trying to find an elephant. Here are 4 ways to use VLOOKUP and LOOKUP functions to perform fuzzy search.

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

Today I will share with you several methods of fuzzy search.

Conventional fuzzy search is divided into two situations, one is numerical value; the other is text.

1. Numerical fuzzy search

First we share about fuzzy search of numerical values.

Example:

A company needs to customize work clothes for new employees. Now it needs to match the size of the clothes to the actual height of the employee.

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

#In this case, it is necessary to use fuzzy search to return the size corresponding to the height of each employee. There are two ways to do this.

Method 1: LOOKUP

Function formula: =LOOKUP(B2,{0;165;170;175;180; 185;190},{"S";"M";"L";"XL";"XXL";"XXXL";"XXXXL"})

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

Formula analysis:

This is to complete the fuzzy search in the form of LOOKUP vector. It can be understood as finding which interval the B2 cell is in {0;165;170;175;180;185;190}. If it is within a certain interval, the corresponding {"S";"M";"L";"XL will be returned. ";"XXL";"XXXL";"XXXXL"} text information.

For example, if 169 is between 165-170, then "M" text information will be returned.

The corresponding relationship between intervals here is as follows. 0 to less than 165 belongs to S size; 165 to less than 170 belongs to M size, and so on, until 190 or more belongs to XXXXL size.

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

If you don’t understand this, you can check the fourth section of the tutorial "Excel Function Learning: 5 Usage of LOOKUP Function" Routines for interval search”.

Method 2: VLOOKUP

Function formula: =IFERROR(VLOOKUP(B2 5,F:G,2,1) ,"S")

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

When we use the VLOOKUP function in daily work, the fourth parameter always enters 0, which means precise search. The fourth parameter here is 1, represents approximate search.

Formula analysis:

1. Use the function formula =VLOOKUP(B2,F:G,2,1) to return the size corresponding to the maximum value in the target area that is less than or equal to the lookup value . Note: Before using the VLOOKUP function for fuzzy search, the data in the search range F:G must be sorted in ascending order according to the search content (here, height).

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

For example, if we search for 172, then the maximum value less than or equal to 172 in the target area is returned, which is 170, and the corresponding size is M. Since the size of clothing is high rather than low, an employee with a height of 172 must customize L size clothes with a height of 175, so when we search for a match, we need to add 5 to the employee's height, so that the minimum size that is greater than the height can be returned. .

2. The height of some employees is still less than 165 even after adding 5, because 165 in column F is the smallest, so the required value cannot be found in column F for this part of data, and the VLOOKUP function returns an error value# N/A. We hope that all employees less than 165 will customize S numbers, so we use the IFERROR function to redirect the VLOOKUP error result to the text character "S".

2. Fuzzy search of text characters

The following is a fuzzy search of text. For example, by searching for AB, the value corresponding to the AAAABBB cell containing AB in the search area is returned. .

Example:

The following table shows the 2018 annual turnover data of each company, and the company name is the full name. Now we need to match the relevant turnover data based on the company abbreviation in another table.

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

Method 1: VLOOKUP wildcard

Function formula: =VLOOKUP("*" &E2&"*",A:B,2,0)

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

Formula explanation:

* represents all characters, "*"&E2&" *" means all content including the text content of cell E2.

Method 2: LOOKUP FIND

Function formula: =LOOKUP(1,0/FIND(E2,A$2:A$8), B$2:B$8)

[Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search

Explanation of the formula: The

formula uses the LOOKUP search routine. Use the FIND function to determine the position of the text in cell E2 in cells A$2:A$8. If it exists, return a value greater than 0, otherwise return an error value; then 0/FIND(), you will get a set of 0 and error values array; finally, the LOOKUP function takes action, finds the largest value not greater than 1, 0, in the array, and returns the corresponding value in B$2:B$8 based on the position of 0.

By the way: If you only want to find the full name through the abbreviation, the formula can be changed to =LOOKUP(1,0/FIND(E2,A$2:A$8), A$2:A$8).

If you don’t understand, you can read the second section of the tutorial "Excel Function Learning: 5 Usage of LOOKUP Function" "Routines for Accurate Search"

Relevant learning recommendations :excel tutorial

The above is the detailed content of [Organization and Sharing] 4 ways to use VLOOKUP and LOOKUP functions for fuzzy search. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
MEDIAN formula in Excel - practical examplesMEDIAN formula in Excel - practical examplesApr 11, 2025 pm 12:08 PM

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Google Spreadsheet COUNTIF function with formula examplesGoogle Spreadsheet COUNTIF function with formula examplesApr 11, 2025 pm 12:03 PM

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

Excel shared workbook: How to share Excel file for multiple usersExcel shared workbook: How to share Excel file for multiple usersApr 11, 2025 am 11:58 AM

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

How to convert Excel to JPG - save .xls or .xlsx as image fileHow to convert Excel to JPG - save .xls or .xlsx as image fileApr 11, 2025 am 11:31 AM

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

Excel names and named ranges: how to define and use in formulasExcel names and named ranges: how to define and use in formulasApr 11, 2025 am 11:13 AM

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

Standard deviation Excel: functions and formula examplesStandard deviation Excel: functions and formula examplesApr 11, 2025 am 11:01 AM

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

Square root in Excel: SQRT function and other waysSquare root in Excel: SQRT function and other waysApr 11, 2025 am 10:34 AM

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Google Sheets basics: Learn how to work with Google SpreadsheetsGoogle Sheets basics: Learn how to work with Google SpreadsheetsApr 11, 2025 am 10:23 AM

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.