KINLONG
  • Home
  • Profiles ▼
  • Communities ▼
  • Apps ▼
  • Metrics
  • Moderation
首页
  • ▼
  • Log In
  • Share
  • ?
  • IBMIBM

Communities

This community can have members from outside your organization. 宣传社区

  • Log in to participate
0d5a4565-f6ce-42a1-ac3b-cdfaaad6889f Blog

▼ Tags

 

▼ Similar Entries

【Excel高效办公】别再Ctrl+V!...

Blog: 宣传社区
KM Admin 4b0b5240-2731-1037-9513-91eec91f24f4 kmadmin@kinlong.cn
Updated
14 people like thisLikes 14
CommentsComments 11

Re: 【Excel高效办公】电脑文件整...

Blog: 环保管理部
刘洋 1ed8f6c0-f3ab-1039-9dec-ab4bc38c0954
Updated
44 people like thisLikes 44
CommentsComments 2

【Excel高效办公】电脑文件整理费时费...

Blog: 宣传社区
KM Admin 4b0b5240-2731-1037-9513-91eec91f24f4 kmadmin@kinlong.cn
Updated
77 people like thisLikes 77
CommentsComments 37

Re: 【Excel技巧】快记笔记!VL...

Blog: 环保管理部
刘洋 1ed8f6c0-f3ab-1039-9dec-ab4bc38c0954
Updated
56 people like thisLikes 56
CommentsComments 3

【Excel技巧】只会Vlookup函数...

Blog: 宣传社区
KM Admin 4b0b5240-2731-1037-9513-91eec91f24f4 kmadmin@kinlong.cn
Updated
77 people like thisLikes 77
CommentsComments 34

▼ Archive

  • September 2023
  • July 2023
  • June 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • June 2018
  • December 2017
  • April 2017

▼ Links

  • 在线图片编辑器

▼ Blog Authors

宣传社区

View All Entries
Clicking the button causes a full page refresh. The user could go to the "Entry list" region to view the new content.) Entry list

【Excel技巧】快记笔记!VLOOKUP公式中的IF{1,0}原理是这样的!

KM Admin 4b0b5240-2731-1037-9513-91eec91f24f4 kmadmin@kinlong.cn | | Tags:  excel技巧 excel函数 ‎ | 30 Comments ‎ | 378 Views

快记笔记!VLOOKUP公式中的IF{1,0}原理是这样的!

 

 

【Excel技巧】快记笔记!VLOOKUP公式中的IF{1,0}原理是这样的!

 

 

 

本文作者:拉登 Dony

本文来源:拉小登(ID:ladengchupin)

本文编辑:竺兰

 

 

我是拉小登,一个爱梳头的 Excel 老师。

 

有同学问,VLOOKUP 反向查找姓名,怎么用数组公式解决? 原理是什么?

 

 

不用谢!

 

夸我,好吗? 1 个字顶 1 块钱!

 

反向查找

 

 

来看下面这个表格,现在要根据【姓名】查找【员工工号】。

 

 

大家都能想到用 VLOOKUP 函数,但是 VLOOKUP 只能从左往右查找,也就是,只能查找【姓名】右边的数据。 【员工工号】在左边就查不了了。

 

 
▋ 方法 1

 

想要查找也行, 把【员工工号】挪到【姓名】列右边去 ,然后正常写 VLOOKUP 函数就可以了。

 

 

对应的公式如下:

  •  

=VLOOKUP(G2,$A$1:$C$30,2,0)

 

▋ 方法 2

 

把【员工工号】挪到【姓名】的右边,这是必须的一步,否则 VLOOKUP 没法计算。

 

如果不在表格里挪,那就用函数公式挪,所以就有了 IF{1,0} 的公式。

 

 

举个例子,下面的表格中,要把 A 和 B 列数据交换顺序,就可以用 IF{1,0}公式。

 

 

公式如下:

  •  

=IF({1,0},$B$2:$B$7,$A$2:$A$7)

 

IF{1,0}是一个数组公式,本质上和下面的 IF 函数是一样的。

 

如果是 1 就引用 B 列【姓名】,如果是 0,就引用 A 列【员工工号】。

 

 

把两个公式合并成一个公式,参数 1 页变成了一个数组区域的引用$D$1:$E$1。

 

 

把返回值也改成数组区域引用,即: $B$2:$B$7 和$A$2:$A$7,就可以一个公式反馈两列数据。

 

 

最后把 D1:E1 的数值带进去,即{1,0},就得到了最终的公式。

 

 

公式如下:

  • =IF({1,0},$B$2:$B$7,$A$2:$A$7)

 

VLOOKUP 函数中的 IF{1,0}也是一样的道理,用来交换两列的顺序。

 

  • =VLOOKUP(G2,IF({1,0},$B$1:$B$30,$A$1:$A$30),2,0)

 

明白了吗? 不要谢,请【点赞】。

INDEX 函数解决

 

 

其实,对于大多数人,我不推荐用数组公式,不好理解。

 

更为常见的方法,是使用 INDEX 和 MATCH 函数来实现。

 

▋ MATCH 函数

 

首先用 MATCH 函数查找姓名所在的位置。

 

 

公式如下:

  • =MATCH(G2,$B$2:$B$30,0)

 

▋ INDEX 函数

 

然后用 INDEX 根据姓名的位置,在【员工工号】列,查找对应位置的工号并返回。

 

 

公式如下:

  • =INDEX($A$2:$A$30,H2)

 

▋ 合并公式

 

最后把 INDEX 和 MATCH 函数组合到一起,可以实现相同的效果,公式更好理解。

 

 

公式如下:

  • =INDEX(A:A,MATCH(G2,B:B,0))

写在最后

 

 

函数公式,其实就是把我们在表格里的操作,翻译成两个公式的操作。

 

这个和写代码是一样的,自己手动做的事情嫌麻烦,那就用代码来做。

 

无论是代码还是人工手动,要做的事情是一样的,只不过代码做起来效率更高而已。

 

考考你:

 

我用 IF{1,0}写了一个公式,猜一猜公式计算的结果,应该是哪一个?

 

 

公式如下:

  • =IF({1,2},$B$1:$B$7,$A$1:$A$7)

 

计算结果是哪个?

 

 

如果这篇文章对你有帮助,请帮忙「点赞」。

 

 
 

 

  • Add a Comment Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry
Notify Other People
notification_ex

Send Email Notification

Quarantine this entry

deleteEntry
duplicateEntry

Mark as Duplicate

  • Previous Entry
  • Main
  • Next Entry
Feed for Blog Entries | Feed for Blog Comments | Feed for Comments for this Entry
  • Home
  • Help
  • IBM Support Forums
  • Bookmarking Tools
  • Server Metrics
  • Mobile UI
  • About
  • IBM Connections on ibm.com
  • Submit Feedback