如何使用VLOOKUP在Google表格中查找数据

The Google Sheets logo.

VLOOKUP is one of the most misunderstood functions in Google Sheets. It allows you to search through and link together two sets of data in your spreadsheet with a single search value. Here’s how to use it.

VLOOKUP是Google表格中最容易被误解的功能之一。 它使您可以使用单个搜索值搜索电子表格中的两组数据并将其链接在一起。 这是使用方法。

Unlike Microsoft Excel, there’s no VLOOKUP wizard to help you in Google Sheets, so you have to type the formula manually.

与Microsoft Excel不同,没有VLOOKUP向导可以在Google表格中为您提供帮助,因此您必须手动输入公式。

VLOOKUP在Google表格中的工作方式 (How VLOOKUP Works in Google Sheets)

VLOOKUP might sound confusing, but it’s pretty simple once you understand how it works.  A formula that uses the VLOOKUP function has four arguments.

VLOOKUP听起来可能令人困惑,但是一旦您了解了它的工作原理,它就非常简单。 使用VLOOKUP函数的公式具有四个参数。

The first is the search key value you’re looking for, and the second is the cell range you’re searching (e.g., A1 to D10). The third argument is the column index number from your range to be searched, where the first column in your range is number 1, the next is number 2, and so on.

第一个是您要搜索的搜索键值,第二个是您要搜索的单元格范围(例如,A1至D10)。 第三个参数是要搜索的范围中的列索引号,范围中的第一列是数字1,下一个是数字2,依此类推。

The fourth argument is whether the search column has been sorted or not.

第四个参数是搜索列是否已排序。

The pieces that make up a VLOOKUP formula in Google Sheets.

The final argument is only important if you’re looking for the closest match to your search key value. If you’d rather return exact matches to your search key, you set this argument to FALSE.

仅当您正在寻找与搜索键值最接近的匹配项时,最后一个参数才重要。 如果您希望将完全匹配的结果返回给您的搜索关键字,请将此参数设置为FALSE。

Here’s an example of how you might use VLOOKUP. A company spreadsheet might have two sheets: one with a list of products (each with an ID number and price), and a second with a list of orders.

这是如何使用VLOOKUP的示例。 公司电子表格可能有两张纸:一张包含产品列表(每个都有ID号和价格),第二张包含订单列表。

You can use the ID number as your VLOOKUP search value to find the price for each product quickly.

您可以使用ID号作为您的VLOOKUP搜索值,以快速找到每种产品的价格。

One thing to note is VLOOKUP can’t search through data to the left of the column index number. In most cases, you either have to disregard the data in columns to the left of your search key or place your search key data in the first column.

需要注意的一件事是VLOOKUP无法搜索列索引号左侧的数据。 在大多数情况下,您要么必须忽略搜索键左侧列中的数据,要么将搜索键数据置于第一列中。

在单张纸上使用VLOOKUP (Using VLOOKUP on a Single Sheet)

For this example, let’s say you have two tables with data on a single sheet. The first table is a list of employees’ names, ID numbers, and birthdays.

对于此示例,假设您在一张纸上有两个数据表。 第一个表是员工姓名,ID号和生日的列表。

A Google Sheets spreadsheet showing two tables of employee information.

In a second table, you can use VLOOKUP to search for data that uses any of the criteria from the first table (name, ID number, or birthday). In this example, we’ll use VLOOKUP to provide the birthday for a specific employee ID number.

在第二张表中,可以使用VLOOKUP从第一张表中搜索使用任何条件的数据(名称,ID号或生日)。 在此示例中,我们将使用VLOOKUP为特定员工ID号提供生日。

The appropriate VLOOKUP formula for this is =VLOOKUP(F4, A3:D9, 4, FALSE).

合适的VLOOKUP公式是=VLOOKUP(F4, A3:D9, 4, FALSE)

The VLOOKUP function in Google Sheets, used to match data from table A to table B.

To break this down, VLOOKUP uses the F4 cell value (123) as the search key and searches the range of cells from A3 to D9. It returns data from column number 4 in this range (column D, “Birthday”), and, as we want an exact match, the final argument is FALSE.

为了解决这个问题,VLOOKUP使用F4单元格值(123)作为搜索关键字,并搜索从A3到D9的单元格范围。 它返回第4列在此范围内的数据(列D,“生日”),并且,由于我们要精确匹配,因此最后一个参数为FALSE。

In this case, for ID number 123, VLOOKUP returns a birthdate of 19/12/1971 (using the DD/MM/YY format). We’ll expand this example further by adding a column to table B for surnames, making it link the birthday dates to actual people.

在这种情况下,对于ID号123,VLOOKUP返回的出生日期为19/12/1971(使用DD / MM / YY格式)。 我们将通过在表B上添加一列姓氏来进一步扩展此示例,使其将生日日期链接到实际的人。

This requires only a simple change to the formula. In our example, in cell H4, =VLOOKUP(F4, A3:D9, 3, FALSE)searches for the surname that matches ID number 123.

这只需要简单地更改公式即可。 在我们的示例中,在单元格H4中, =VLOOKUP(F4, A3:D9, 3, FALSE)搜索与ID号123相匹配的姓。

VLOOKUP in Google Sheets, returning data from one table to another.

Instead of returning the birthdate, it returns the data from column number 3 (“Surname”) matched to the ID value located in column number 1 (“ID”).

它不返回出生日期,而是返回第3列(“姓”)中与位于第1列(“ ID”)中的ID值匹配的数据。

将VLOOKUP与多张图纸一起使用 (Use VLOOKUP with Multiple Sheets)

The example above used a set of data from a single sheet, but you can also use VLOOKUP to search data across multiple sheets in a spreadsheet. In this example, the information from table A is now on a sheet called “Employees,” while table B is now on a sheet called “Birthdays.”

上面的示例使用了单个工作表中的一组数据,但是您也可以使用VLOOKUP在电子表格中的多个工作表中搜索数据。 在此示例中,表A中的信息现在位于名为“雇员”的工作表上,而表B中的信息现在位于名为“生日”的工作表中。

Instead of using a typical cell range like A3:D9, you can click on an empty cell, and then type: =VLOOKUP(A4, Employees!A3:D9, 4, FALSE).

您可以单击一个空单元格,然后输入: =VLOOKUP(A4, Employees!A3:D9, 4, FALSE)来代替使用典型的单元格范围(如A3:D9 =VLOOKUP(A4, Employees!A3:D9, 4, FALSE)

VLOOKUP in Google Sheets, returning data from one sheet to another.

When you add the name of the sheet to the beginning of the cell range (Employees!A3:D9), the VLOOKUP formula can use the data from a separate sheet in its search.

当您将工作表的名称添加到单元格区域的开头(Employees!A3:D9)时,VLOOKUP公式可以在其搜索中使用来自单独工作表的数据。

在VLOOKUP中使用通配符 (Using Wildcards with VLOOKUP)

Our examples above used exact search key values to locate matching data. If you don’t have an exact search key value, you can also use wildcards, like a question mark or an asterisk, with VLOOKUP.

上面的示例使用了精确的搜索键值来定位匹配的数据。 如果您没有确切的搜索关键字值,也可以在VLOOKUP中使用通配符,例如问号或星号。

For this example, we’ll use the same set of data from our examples above, but if we move the “First Name” column to column A, we can use a partial first name and an asterisk wildcard to search the surnames of employees.

对于此示例,我们将使用与上面示例相同的数据集,但是如果将“名字”列移至A列,则可以使用部分名字和星号通配符来搜索员工的姓氏。

The VLOOKUP formula to search for surnames using a partial first name is =VLOOKUP(B12, A3:D9, 2, FALSE); your search key value goes in cell B12.

使用部分名字搜索姓氏的VLOOKUP公式为=VLOOKUP(B12, A3:D9, 2, FALSE); 您的搜索键值将进入单元格B12。

In the example below, “Chr*” in cell B12 matches the surname “Geek” in the sample lookup table.

在下面的示例中,单元格B12中的“ Chr *”与样本查找表中的姓“ Geek”匹配。

The results of a surname wildcard VLOOKUP search used in Google Sheets.

用VLOOKUP搜索最接近的匹配项 (Searching for the Closest Match with VLOOKUP)

You can use the final argument of a VLOOKUP formula to search for either an exact or closest match to your search key value. In our previous examples, we searched for an exact match, so we set this value to FALSE.

您可以使用VLOOKUP公式的最后一个参数来搜索与您的搜索键值完全匹配或最接近的匹配。 在前面的示例中,我们搜索了完全匹配的内容,因此我们将此值设置为FALSE。

If you want to find the closest match to a value, change VLOOKUP’s final argument to TRUE. As this argument specifies whether a range is sorted or not, make sure your search column is sorted from A-Z, or it won’t work correctly.

如果要查找与值最接近的匹配项,请将VLOOKUP的最终参数更改为TRUE。 由于此参数指定是否对范围进行排序,请确保您的搜索列是按AZ排序的,否则它将无法正常工作。

In our table below, we have a list of items to buy (A3 to B9), along with item names and prices. They’re sorted by price from lowest to highest. Our total budget to spend on a single item is $17 (cell D4). We used a VLOOKUP formula to find the most affordable item on the list.

在下表中,我们列出了要购买的商品(A3至B9)以及商品名称和价格。 它们按价格从最低到最高排序。 我们用于单个项目的总预算为$ 17(单元格D4)。 我们使用VLOOKUP公式在列表中找到最实惠的商品。

The appropriate VLOOKUP formula for this example is =VLOOKUP(D4, A4:B9, 2, TRUE). Because this VLOOKUP formula is set to find the nearest match lower than the search value itself, it can only look for items cheaper than the set budget of $17.

对于此示例,适当的VLOOKUP公式为=VLOOKUP(D4, A4:B9, 2, TRUE) 。 因为此VLOOKUP公式设置为查找比搜索值本身低的最接近匹配项,所以它只能查找比设置的预算(17美元)便宜的商品。

In this example, the cheapest item under $17 is the bag, which costs $15, and that’s the item the VLOOKUP formula returned as the result in D5.

在此示例中,最便宜的商品在$ 17以下是袋子,价格为$ 15,这是VLOOKUP公式作为D5中的结果返回的商品。

A VLOOKUP in Google Sheets with sorted data to find the nearest value to the search key value.

翻译自: https://www.howtogeek.com/447024/how-to-find-data-in-google-sheets-with-vlookup/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278417.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

共享内存

https://blog.csdn.net/tojohnonly/article/details/70246965 转载于:https://www.cnblogs.com/132818Creator/p/10307072.html

WPF项目学习.一

WPF项目搭建 版权声明:本文为博主初学经验,未经博主允许不得转载。 一、前言 记录在学习与制作WPF过程中遇到的解决方案。 使用MVVM的优点是 数据和视图分离,双向绑定,低耦合,可重用行,相对独立的设计和逻辑…

airpods_如何通过AirPods与其他人共享音乐

airpodsKhamosh PathakKhamosh PathakUsing the new Audio Sharing feature introduced in iOS 13.1 and iPadOS 13.1, you can share audio from one iPhone with two AirPods. You can watch a video or listen to a song along with your friend in just a tap! 使用iOS 13.…

Laravel 5 多个视图共享数据的方法

我们都知道模板一般会用到继承,导航栏就是一个很好的例子,但是导航栏的数据如何共享,比如有个导航的文件叫在view/navigation.blade.php为了简单一点,文件里只有设置了一个变量1{{ $cqh }}现在的要求是每个页面都会用到这个变量&a…

HR面 - 十大经典提问

1、HR:你希望通过这份工作获得什么? 1)、自杀式回答:我希望自己为之工作的企业能够重视质量,而且会给做得好的员工予以奖励。我希望通过这份工作锻炼自己,提升自己的能力,能让公司更加重视我。 …

谷歌云使用账号密码_如何使用Google密码检查

谷歌云使用账号密码Google has a tool designed to securely analyze your passwords against a database of ones that are known to be compromised and breached. Password Checkup is available as an extension or a web service. Here’s how to use it. Google提供了一种…

HTML特殊字符编码对照表

HTML特殊字符编码对照表 特殊符号命名实体十进制编码特殊符号命名实体十进制编码特殊符号命名实体十进制编码ΑΑΒΒΓΓΔΔΕΕΖΖΗΗΘΘΙΙΚΚΛΛΜΜΝ&a…

CentOS 7.0下使用yum安装MySQL

CentOS7默认数据库是mariadb,配置等用着不习惯,因此决定改成mysql,但是CentOS7的yum源中默认好像是没有mysql的。为了解决这个问题,我们要先下载mysql的repo源。1.下载mysql的repo源$ wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm2.安装my…

Jolicloud是一款适合上网本的漂亮新操作系统

Want to breathe new life into your netbook? Here’s a quick look at Jolicloud, a unique new Linux based OS that lets you use your netbook in a whole new way. 想为您的上网本注入新的活力吗? 快速浏览一下Jolicloud,这是一个独特的基于Linu…

Repeater片段

1.字段过长截取字符串 1.1 截取字符串类 可以直接substring 也可以<%# Utility.Common.GetShow( Eval("NewTitle").ToString(),20,true) %><td><%#fcwms.Common.GetContent.GetShow(Eval("com_address").ToString(), 19, true)%> </t…

谷歌浏览器的翻译功能在哪_如何在Google表格中使用AND和OR功能

谷歌浏览器的翻译功能在哪If you’ve ever wanted to check whether data from your Google Sheets spreadsheet meets certain criteria, you can use AND and OR. These logical functions give you TRUE and FALSE responses, which you can use to sort through your data.…

Reptile:requests + Xpath 爬取段子网的段子

2019/1/24 中午路飞学成 爬虫课程 实验及笔记。 Xpath是路飞爬虫课程中老师说的三种解析方式之一&#xff0c;前面是re正则表达式的解析方式&#xff0c;现在是xpath的解析方式&#xff0c;后面还有一个是bs4的解析方式。 re其实我理解的很困难&#xff0c;而且到现在都还不怎么…

Android 系统权限

Android 是一个权限分隔的操作系统&#xff0c;其中每个应用都有其独特的系统标识&#xff08;Linux 用户 ID 和组 ID&#xff09;。系统各部分也分隔为不同的标识。Linux 据此将不同的应用之间、应用与系统之间分隔开来 ##一、安全架构 Android 安全架构的中心设计点是&#x…

【转载】负数的二进制

https://jingyan.baidu.com/article/29697b9106eb52ab21de3c7a.html 将十进制的负数变成二进制数的过程&#xff1a; 1.写出绝对值的二进制码&#xff08;原码&#xff09; 2.取反&#xff08;反码&#xff09; 3.1,&#xff08;补码&#xff09; 同理&#xff0c;将二进制的负…

保存网络文章以供以后使用Instapaper阅读

Have you ever come across a bunch of great articles that you want to read online, but just don’t have the time? Today we take a look at an online service that allows you to read your articles later, either online, or on an iPhone, or eReader. 您是否曾经遇…

谷歌chrome xp_将非Google任务列表添加到Chrome

谷歌chrome xpMost people rely on a task list to help them remember what they need to do but not everyone wants one that is tied to a Google account. If you have been wanting an independent tasks list then join us as we look at the Tasks extension for Googl…

学习笔记 - MarkDown 语法

学习参考网址&#xff1a;https://www.appinn.com/markdown/index.html # **gitskill**## 标题 ># 这是 H1 >## 这是 H2 >###### 这是 H6## 区块引用 Blockquotes > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipisci…

[BZOJ4671]异或图

description BZOJ 定义两个结点数相同的图\(G1\)与图\(G2\)的异或为一个新的图\(G\), 其中如果\((u,v)\)在\(G1\)与\(G2\)中的出现次数之和为\(1\), 那么边\((u,v)\)在\(G\)中, 否则这条边不在\(G\)中. 现在给定\(s\)个结点数相同的图\(G1...s\),设\(S{G1,G2,...,Gs},\) 问\(S\…

我们生活在最好的时代

2019独角兽企业重金招聘Python工程师标准>>> 没规划的人生叫拼图&#xff0c;有规划的人生叫蓝图&#xff1b; 没目标的人生叫流浪&#xff0c;有目标的人生叫航行&#xff01; 我们生活在最好的时代&#xff1a;在认知和学习机会上&#xff0c;人人平等&#xff0c…

MapReduce详解和WordCount模拟

最早接触大数据&#xff0c;常萦绕耳边的一个词「MapReduce」。它到底是什么&#xff0c;能做什么&#xff0c;原理又是什么&#xff1f;且听下文讲解。 是什么 MapReduce 即是一个编程模型&#xff0c;又是一个计算框架&#xff0c;它充分采用了分治的思想&#xff0c;将数据处…