https://support.office.com/en-us/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1

Use VLOOKUP, one of the lookup and reference functions, when you need to find things in a table or a range by row.

For example, look up a price of an automotive part by the part number.

In its simplest form, the VLOOKUP function says:

=VLOOKUP(Value you want to look up, range where you want to lookup the value, the column number in the range containing the return value, Exact Match or Approximate Match – indicated as 0/FALSE or 1/TRUE).

This video is part of a training course called VLOOKUP: When and how to use it.

Technical details

Use the VLOOKUP function to look up a value in a table.

Syntax

VLOOKUP (lookup_value, table_array, col_index_num, [range_lookup])

For example:

  • =VLOOKUP(105,A2:C7,2,TRUE)

  • =VLOOKUP("Fontana",B2:E7,2,FALSE)

lookup_value    (required)

The value you want to look up. The value you want to look up must be in the first column of the range of cells you specify in table-array .

For example, if table-array spans cells B2:D7, then your lookup_value must be in column B. See the graphic below. Lookup_value can be a value or a reference to a cell.

table_array    (required)

The range of cells in which the VLOOKUP will search for the lookup_value and the return value.

The first column in the cell range must contain the lookup_value (for example, Last Name in the picture below.) The cell range also needs to include the return value (for example, First Name in the graphic below) you want to find.

Learn how to select ranges in a worksheet.

col_index_num    (required)

The column number (starting with 1 for the left-most column of table-array) that contains the return value.

range_lookup   (optional)

A logical value that specifies whether you want VLOOKUP to find an approximate or an exact match:

  • TRUE assumes the first column in the table is sorted either numerically or alphabetically, and will then search for the closest value. This is the default method if you don't specify one.

  • FALSE searches for the exact value in the first column.

How to get started

There are four pieces of information that you will need in order to build the VLOOKUP syntax:

  1. The value you want to look up, also called the lookup value.

  2. The range where the lookup value is located. Remember that the lookup value should always be in the first column in the range for VLOOKUP to work correctly. For example, if your lookup value is in cell C2 then your range should start with C.

  3. The column number in the range that contains the return value. For example, if you specify B2: D11 as the range, you should count B as the first column, C as the second, and so on.

  4. Optionally, you can specify TRUE if you want an approximate match or FALSE if you want an exact match of the return value. If you don't specify anything, the default value will always be TRUE or approximate match.

Now put all of the above together as follows:

=VLOOKUP(lookup value, range containing the lookup value, the column number in the range containing the return value, optionally specify TRUE for approximate match or FALSE for an exact match).

最新文章

  1. linux shell 变量
  2. SQL Case when 的使用方法(转)
  3. 淘金客II项目问题日志(AngularJs+BootStrap+Api接口开发)
  4. 求助,JS 方法调用的问题,写了返回值,确调用时返回Undefined(新人第一次写)
  5. [C#] 语法之Attribute
  6. GMT、UTC、PDT 时间是什么?Linux下如何调整时区
  7. 学习笔记——单例模式Singleton
  8. 在Visual Studio 2013 中使用C++单元测试
  9. ppt制作元素采集
  10. 苹果8plus怎么录屏视频
  11. JavaScript深入之执行上下文栈
  12. 使用ZXing.Net生成与识别二维码(QR Code)
  13. 19/03/17Python笔记
  14. javascript学习笔记(七):事件详解
  15. hdu 5781 ATM Mechine dp
  16. redis配置文件相关
  17. java学习笔记记录
  18. js复制兼容:ZeroClipboard复制到剪切板(支持IE、FF、Chrome)
  19. Linux(centos7)安装maven3.5
  20. C 判断成绩是否及格

热门文章

  1. HDU - 4758 Walk Through Squares (AC自己主动机+DP)
  2. Android 中文字体的设置方法和使用技巧
  3. Java类载入器
  4. chrome的F12的inspect使用
  5. C++之易混淆知识点二
  6. (转载)[Android开发]zxing扫描结果乱码
  7. 用Maven创建第一个web项目Struts2项目
  8. 使用dispatch_group来进行线程同步
  9. 优动漫PAINT基础系列之图层模式
  10. Python 曲线拟合