ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 2455|回复: 7

求助lookup的解释

[复制链接]

TA的精华主题

TA的得分主题

发表于 2011-2-7 10:39 | 显示全部楼层 |阅读模式
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
我有一个lookup的问题求大侠指点,我已经问了好多人了,都解释的不是很清楚,所以我想求一位大侠留下一个可以联系上的方式,邮箱或者qq或者电话都可以,我想单独请教他,先谢过了~

TA的精华主题

TA的得分主题

发表于 2011-2-7 11:00 | 显示全部楼层
不知你还有哪里不理解的

TA的精华主题

TA的得分主题

发表于 2011-2-7 11:00 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2011-2-7 11:10 | 显示全部楼层
原帖由 ruoshui1123 于 2011-2-7 10:39 发表
我有一个lookup的问题求大侠指点,我已经问了好多人了,都解释的不是很清楚,所以我想求一位大侠留下一个可以联系上的方式,邮箱或者qq或者电话都可以,我想单独请教他,先谢过了~

楼主说的让人不敢回答!到底问题出在哪里呢?是老师的水平不够,还是……?!
看看帮助文件吧,英文版的或者中文版的,怎么都行!我们多数人也都是这么过来的!

TA的精华主题

TA的得分主题

发表于 2011-2-7 11:12 | 显示全部楼层
我这里的只有英文版的,供你参考!
LOOKUP
Show All
Hide All
Returns a value either from a one-row or one-column range or from an array (array: Used to build single formulas that produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array range shares a common formula; an array constant is a group of constants used as an argument.). The LOOKUP function has two syntax forms: the vector form and the array form.If you want to Then see Usage
Look in a one-row or one-column range (known as a vector) for a value and return a value from the same position in a second one-row or one-column range Vector form Use the vector form when you have a large list of values to look up or when the values may change over time.
Look in the first row or column of an array for the specified value and return a value from the same position in the last row or column of the array Array form Use the array form when you have a small list of values and the values remain constant over time.


Note    You can also use the LOOKUP function as an alternative to the IF function for elaborate tests or tests that exceed the limit for nesting of functions. See the examples in the array form.


--------------------------------------------------------------------------------

Vector form
A vector is a range of only one row or one column. The vector form of LOOKUP looks in a one-row or one-column range (known as a vector) for a value and returns a value from the same position in a second one-row or one-column range. Use this form of the LOOKUP function when you want to specify the range that contains the values that you want to match. The other form of LOOKUP automatically looks in the first column or row.

LOOKUP(lookup_value,lookup_vector,result_vector)

Lookup_value  A value that LOOKUP searches for in the first vector. Lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.

Lookup_vector  A range that contains only one row or one column. The values in lookup_vector can be text, numbers, or logical values.

Important  The values in lookup_vector must be placed in ascending order: ...,-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give the correct value. Uppercase and lowercase text are equivalent.

Result_vector  A range that contains only one row or column. It must be the same size as lookup_vector.

Remarks

If LOOKUP can't find the lookup_value, it matches the largest value in lookup_vector that is less than or equal to lookup_value.
If lookup_value is smaller than the smallest value in lookup_vector, LOOKUP gives the #N/A error value.
Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

Create a blank workbook or worksheet.
Select the example in the Help topic.
Note    Do not select the row or column headers.



Selecting an example from Help
Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
   
1
2
3
4
5
6
A B
Frequency Color
4.14 red
4.19 orange
5.17 yellow
5.77 green
6.39 blue
Formula Description (Result)
=LOOKUP(4.19,A2:A6,B2:B6) Looks up 4.19 in column A, and returns the value from column B that's in the same row (orange)
=LOOKUP(5.00,A2:A6,B2:B6) Looks up 5.00 in column A, matches the next smallest value (4.19), and returns the value from column B that's in the same row (orange)
=LOOKUP(7.66,A2:A6,B2:B6) Looks up 7.66 in column A, matches the next smallest value (6.39), and returns the value from column B that's in the same row (blue)
=LOOKUP(0,A2:A6,B2:B6) Looks up 0 in column A, and returns an error because 0 is less than the smallest value in the lookup_vector A2:A7 (#N/A)


Top of Page


--------------------------------------------------------------------------------

Array form
The array form of LOOKUP looks in the first row or column of an array (array: Used to build single formulas that produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array range shares a common formula; an array constant is a group of constants used as an argument.) for the specified value and returns a value from the same position in the last row or column of the array. Use this form of LOOKUP when the values that you want to match are in the first row or column of the array. Use the other form of LOOKUP when you want to specify the location of the column or row.

Tip  In general, it's best to use the HLOOKUP or VLOOKUP function instead of the array form of LOOKUP. This form of LOOKUP is provided for compatibility with other spreadsheet programs.

LOOKUP(lookup_value,array)

Lookup_value  A value that LOOKUP searches for in an array. Lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.

If LOOKUP can't find the lookup_value, it uses the largest value in the array that is less than or equal to lookup_value.

If lookup_value is smaller than the smallest value in the first row or column (depending on the array dimensions), LOOKUP returns the #N/A error value.
Array  A range of cells that contains text, numbers, or logical values that you want to compare with lookup_value.

The array form of LOOKUP is very similar to the HLOOKUP and VLOOKUP functions. The difference is that HLOOKUP searches for lookup_value in the first row, VLOOKUP searches in the first column, and LOOKUP searches according to the dimensions of array.

If array covers an area that is wider than it is tall (more columns than rows), LOOKUP searches for lookup_value in the first row.

If array is square or is taller than it is wide (more rows than columns), LOOKUP searches in the first column.

With HLOOKUP and VLOOKUP, you can index down or across, but LOOKUP always selects the last value in the row or column.
Important  The values in array must be placed in ascending order: ...,-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give the correct value. Uppercase and lowercase text are equivalent.

Example 1
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

Create a blank workbook or worksheet.
Select the example in the Help topic.
Note    Do not select the row or column headers.



Selecting an example from Help
Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
   
1
A B
Formula Description (Result)
=LOOKUP("C",{"a","b","c","d";1,2,3,4}) Looks up "C" in the first row of the array, finds the largest value that is less than or equal to it ("c"), and then returns the value in the last row that's in the same column (3)
=LOOKUP("bump",{"a",1;"b",2;"c",3}) Looks up "bump" in the first row of the array, finds the largest value that is less than or equal to it ("b"), and then returns the value in the last column that's in the same row (2)


Example 2
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

Create a blank workbook or worksheet.
Select the example in the Help topic.
Note    Do not select the row or column headers.



Selecting an example from Help
Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
The following example uses an array of numbers to assign a letter grade to a test score.

   
1
2
3
4
A
Score
45
90
78
Formula Description (Result)
=LOOKUP(A2,{0,60,70,80,90},{"F","D","C","B","A"})  Looks up the value in A2 (45) in the first row of the array, finds the largest value that is less than or equal to it (60), and then returns the value in the last row of the array that's in the same column (F)
=LOOKUP(A3,{0,60,70,80,90},{"F","D","C","B","A"})  Looks up the value in A3 (90) in the first row of the array, finds the largest value that is less than or equal to it (90), and then returns the value in the last row of the array that's in the same column (A)
=LOOKUP(A4,{0,60,70,80,90},{"F","D","C","B","A"})  Looks up the value in A4 (78) in the first row of the array, finds the largest value that is less than or equal to it (80), and then returns the value in the last row of the array that's in the same column (C)
=LOOKUP(A2,{0,60,63,67,70,73,77,80,83,87,90,93,97},{"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"}) Looks up the value in A2 (45) in the first row of the array, finds the largest value that is less than or equal to it (60), and then returns the value in the last row of the array that's in the same column (F)
=LOOKUP(A3,{0,60,63,67,70,73,77,80,83,87,90,93,97},{"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"}) Looks up the value in A3 (90) in the first row of the array, finds the largest value that is less than or equal to it (90), and then returns the value in the last row that's in the same column (A-)
=LOOKUP(A4,{0,60,63,67,70,73,77,80,83,87,90,93,97},{"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"}) Looks up the value in A4 (78) in the first row of the array, finds the largest value that is less than or equal to it (80), and then returns the value in the last row that's in the same column (C+)

TA的精华主题

TA的得分主题

发表于 2011-2-7 11:17 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助

回复 5楼 lu_zhao_long 的帖子

老师你这个太强大了,也许给他增加了更多的难度,

TA的精华主题

TA的得分主题

发表于 2011-2-7 11:27 | 显示全部楼层
原帖由 twtthduu 于 2011-2-7 11:17 发表
老师你这个太强大了,也许给他增加了更多的难度,

6 楼能给楼主附上中文版的 LOOKUP 帮助文件吗?否则你怎么才能让楼主来说明他哪点不明白呢?万一他需要英文版的帮助文件,我上传的帮助文件就有用喽!

TA的精华主题

TA的得分主题

 楼主| 发表于 2011-2-7 13:36 | 显示全部楼层
英文版的是原版的,估计也是最准确的,但是我真的更迷惑了,哈哈 希望老师给与指导阿
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-12-23 23:31 , Processed in 0.031873 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表