提示:其它语言是由 Google 机器翻译的。 你可以访问 English 版本。
登录
x
or
x
x
马上登记
x

or

如何在Excel中查找第一个,2nd或第n个匹配值?

假设您有两列产品和数量如下图所示。 为了快速找出第一或第二批香蕉的数量,你会怎么做?

这里的查找功能可以帮助你解决这个问题。 在本文中,我们将向您展示如何使用Excel中的Vlookup函数查找第一个,第二个或第n个匹配值。

Vlookup使用公式在Excel中找到第一个,2nd或第n个匹配值

使用Kutools for Excel轻松地在vlookup中找到Excel中的第一个匹配值


将多个工作表/工作簿合并到一个工作表/工作簿中:

将多个工作表或工作簿合并到一个工作表或工作簿中可能是您​​日常工作中的一项重大任务。 但是,如果你有 Kutools for Excel,其强大的效用 - 结合 可以帮助您将多个工作表,工作簿快速合并到一个工作表或工作簿中。 立即下载Kutools for Excel的全功能60天免费试用版!

Kutools for Excel:比200方便的Excel加载项,可以在60天免费试用。 立即下载免费试用版!

Office选项卡在Office中启用选项卡式编辑和浏览,使您的工作更轻松......
Kutools for Excel - 最佳办公生产力工具将解决您的大部分Excel问题
  • 重用任何东西: 将最常用或最复杂的公式,图表和其他任何内容添加到您的收藏夹中,并在将来快速重复使用它们。
  • 超过20文本功能: 从文本字符串中提取数字; 提取或删除部分文本; 将数字和货币转换为英语单词...
  • 合并工具:多个工作簿和表格合二为一; 合并多个单元格/行/列而不丢失数据; 合并重复行和总和...
  • 拆分工具:根据价值将数据拆分为多个表格; 一个工作簿到多个Excel,PDF或CSV文件; 一列到多列......
  • 粘贴跳过 隐藏/过滤行; 数和总和 按背景颜色; 创建邮件列表和 通过Cell的价值发送电子邮件...
  • 超级过滤器: 创建高级过滤方案并应用于任何工作表; 排序 按周,日,频率等; 筛选 通过大胆,公式,评论......
  • 超过300强大的功能; 适用于Office 2007-2019和365; 支持所有语言; 在公司轻松部署; 全功能60天免费试用。

箭头蓝色右泡 Vlookup在Excel中找到第一个,2nd或第n个匹配值

请按照以下步骤查找Excel中的第一个2nd或第n个匹配值。

1。 在单元格D1中,输入你想要查看的条件,在这里我输入香蕉。

2。 在这里,我们将找到香蕉的第一个匹配值。 选择一个空白单元格,如E2,复制和粘贴公式 =INDEX($B$2:$B$6,MATCH(TRUE,EXACT($D$1,$A$2:$A$6),0)) 进入配方栏,然后按 按Ctrl + 转移 + 输入 键同时。

注意:在此公式中,$ B $ 2:$ B $ 6是匹配值的范围; $ A $ 2:$ A $ 6是包含所有vlookup条件的范围; $ D $ 1是包含指定的查找条件的单元格。

然后您将在E2单元格中获得香蕉的第一个匹配值。 使用此公式,您只能根据您的条件获得第一个相应的值。

要获得任何第n个相对值,可以应用以下公式: =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),1)) + 按Ctrl + 转移 + 输入 键一起,这个公式将返回第一个匹配的值。

笔记:

1。 要找到第二个匹配值,请将上述公式更改为 =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),2)),然后按 按Ctrl + 转移 + 输入 键同时。 看截图:

2。 上面公式中的最后一个数字表示vlookup条件的第n个匹配值。 如果将它更改为3,它将得到第三个匹配值,并更改为n,第n个匹配值将被查出。


箭头蓝色右泡 Vlookup通过Kutools for Excel在Excel中找到第一个匹配值

You可以很容易地在Excel中找到第一个匹配值,而不用记住公式 在列表中寻找一个值 配方公式 Kutools for Excel.

Kutools for Excel : 与超过300方便的Excel加载项,在60天免费试用没有限制.

1。 选择一个单元格来查找第一个匹配值(称为单元格E2),然后单击 Kutools > 配方助手 > 在列表中寻找一个值。 看截图:

doc vlookup返回相邻的下一个单元格010

2。 在里面 配方助手 对话框:

1)。 在里面 表格数组 框中,选择包含第一个匹配值的表格。

2)。 指定包含您在查找中需要查找的条件的单元格(单元格D1) Look_value 框。

3)。 选择具有第一个匹配值的列 框,最后点击 OK 按钮。

现在将根据下拉列表选择在单元格C10中自动填充相应的单元格值。

提示。如果您想免费试用此实用程序,请转到 免费下载软件 首先,按照上述步骤进行操作。


Office Tab - 在Excel中选项卡式浏览,编辑和管理工作簿:

Office选项卡将Web浏览器(如Google Chrome,Internet Explorer新版本和Firefox)中显示的选项卡界面带到Microsoft Excel。 它将是一个节省时间的工具,在您的工作中无可比拟。 见下面的演示:

点击免费试用Office Tab!

Excel的Office选项卡


Kutools for Excel - 最佳办公生产力工具提高80%的生产力

  • 重用: 快速插入 复杂的公式,图表 以及你以前用过的任何东西; 加密单元格 密码; 创建邮件列表 并发送电子邮件...
  • 超级方程式酒吧 (轻松编辑多行文字和公式); 阅读布局 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不丢失数据; 分裂细胞含量; 组合重复的行/列...防止重复的细胞; 比较范围...
  • 选择复制或唯一 行; 选择空行 (所有细胞都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择......
  • 精确复制 多个单元格而不更改公式参考; 自动创建参考 多张表; 插入项目符号,复选框等等......
  • 提取文本,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级过滤器 (将过滤方案保存并应用到其他工作表); 高级排序 按月/周/日,频率等; 特殊过滤器 用粗体,斜体......
  • 结合工作簿和工作表; 根据键列合并表; 将数据拆分为多个表格; 批量转换xls,xlsx和PDF...
  • 超过300强大的功能。 支持Office / Excel 2007-2019和365。 支持所有语言。 在您的企业或组织中轻松部署。 全功能60天免费试用。
kte tab 201905

Office选项卡为Office提供选项卡式界面,使您的工作更轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,Publisher,Access,Visio和Project。
  • 在同一窗口的新选项卡中打开并创建多个文档,而不是在新窗口中。
  • 通过50%提高您的工作效率,每天为您减少数百次鼠标点击!
官方底部
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Mark Rashleigh · 6 months ago
    If the first or any of the other entry's for 'banana' column B was blank cell, of which I don't require this number, what changes are required to this formula to skip blank cell in column B.
    • To post as a guest, your comment is unpublished.
      Mark Rashleigh · 6 months ago
      Sorry I am using this formula
      =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),1))
      • To post as a guest, your comment is unpublished.
        Mark Rashleigh · 6 months ago
        SOLVED:
        =SMALL(IF(A2:A7=D1,IF(B2:B7<>"",B2:B7)),1)

        If 2nd or 3rd number required exchange ),1) to 2 or 3

        This formula does not require index, as it directly looks at the value in Cell
        • To post as a guest, your comment is unpublished.
          Mark Rashleigh · 6 months ago
          Correction to previous formula:
          The value was reading either the lesser or greater.

          Updated formula
          =INDEX($B$2:$B$7,SMALL(IF($A2:$A6=$D$1,IF($B$2:$B$7<>"",ROW($A2:$A6)-ROW($A2)+1)),1))

          This skips blank cell and places value of non blank cell. Replace +1 with +2 or +3 for 2nd or 3rd value
  • To post as a guest, your comment is unpublished.
    JAntonio · 7 months ago
    And if you want the last, second last, nth last just add a counter (count the number of events already hapenned) to the end and subtract it by 0,1,n respectively.

    Thank you so much! I was searching for this for a long time
    • To post as a guest, your comment is unpublished.
      crystal · 7 months ago
      Good Day,
      Sorry can't help you with this yet. Thank you for your comment.
  • To post as a guest, your comment is unpublished.
    Seth · 8 months ago
    Is it possible to find an average of the non-unique data. Or would it be possible to have a list dropdown on the cell of the various values?
    • To post as a guest, your comment is unpublished.
      crystal · 7 months ago
      Good Day,
      Sorry can't help you with this yet. Thank you for your comment.
  • To post as a guest, your comment is unpublished.
    Santosh · 9 months ago
    if a member was called on 1st October (October Data Set)as and it wasn’t revived, again the cce called him on 15th November(November Data Set). The member is revived on 16th November. While checking the revival using VLookup it makes YES to both the entries of October & November. How to avoid like it should show “YES” for the November entry actually when it was revived, and also leave the October entry as “NO”.
  • To post as a guest, your comment is unpublished.
    Sim Van Narith · 1 years ago
    Dear Ms/Mr,

    I have a problem:
    I knew a quantities of the product, I want to finding out the product name of the first or second match value of 200, what would you do?
    Big Thanks !

    Sim Van Narith
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Good day,
      Supposing the value of 200 locates in cell F2, please try this formula: =VLOOKUP(F2,IF({1,0},$B$2:$B$7,$A$2:$A$7),2,0).
      Hope it can help. Thanks for your comment.
  • To post as a guest, your comment is unpublished.
    Matt · 1 years ago
    Is it possible to use this formula to find if a number is between two numbers. Below is my formula. Trying to see if a listing with individuals and an amount is between to other set cells (Example: $50,000 and $74,999)


    =ArrayFormula(INDEX('4 - Donors List'!$B$2:$B$1000,SMALL(IF('4 - Donors List'!$F$2:$F$1000>=D$2,ROW('4 - Donors List'!$F$2:$F$1000)-ROW('4 - Donors List'!$F$2)+1),$A6)))
  • To post as a guest, your comment is unpublished.
    R. G. · 1 years ago
    I have a little problem with this formula, it doesn't work exactly for my case:
    =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),1)) + Ctrl + Shift + Enter

    what if the criteria I am looking for is not exactly the same each time (Banana), but rather it becomes part of a phrase (banana republic) and so on; what then? By changing the "n" number at the end of this formula, I get "#NUM!" response. I have a column of vocabulary that I want to search for their meaning in the second column, and by typing one word, I need to get all occurrence of that word in any phrase to be listed. Any help on this?
    Thanks,
    R.G.
  • To post as a guest, your comment is unpublished.
    Christina · 1 years ago
    My current formula is {=IFERROR(INDEX(Sheet3!$C$2:$C$596,SMALL(IF(Sheet3!$A$2:$A$596=Sheet2!A19,ROW(Sheet3!$A$2:$A$596)-ROW(INDEX(Sheet3!$A$2:$A$596,1,1))+1),P19)),0)} But how would I apply this with multiple criteria, say two matches?
    • To post as a guest, your comment is unpublished.
      sunil · 9 months ago
      My problem is similar
      ping me if you find solution
      • To post as a guest, your comment is unpublished.
        Jones · 9 months ago
        create an auxiliary column wich concatenates your criterias, then use the concatenate as the criteria!

        Hope it works!
  • To post as a guest, your comment is unpublished.
    JB · 1 years ago
    Awesome tutorial! Worked like a charm, even across multiple sheets in the same file! Many thanks!!
  • To post as a guest, your comment is unpublished.
    Abby · 1 years ago
    Hi,
    I applied this formula but in my case I have numbers in place of the product name. When I drag down the formula to look for the next number in the list I get an error.

    events volume odd events only volume
    1 0.3 1 0.3
    1 2.5 1 2.5
    2 1.1 3 #NUM
    2 0.5 3 #NUM
    3 0
    3 0.2
    3 1
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Dear Abby,
      The drag down feature can only work for same vlookup values. But in your case, the vlookup values are different (1 and 3).
      Please use this array formula: =IFERROR(INDEX($B$2:$B$8,SMALL(IF($C$4=$A$2:$A$8,ROW($A$2:$A$8)-ROW($A$2)+1),1+(ROW(A1)-1))), "") + Ctrol + Shift + Enter, and drag down the formula to get all matched values in the same vlookup value as below screenshot shown.
  • To post as a guest, your comment is unpublished.
    Warthogb · 2 years ago
    How can I increase last number automatically when dragging the formula down: =INDEX($B$2:$B$6,SMALL(IF($D$1=$A$2:$A$6,ROW($A$2:$A$6)-ROW($A$2)+1),2)),
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Dear Warthogb,

      If you want to automatically get all matched values by dragging the formula down, please apply the following array formula:



      =IFERROR(INDEX($B$2:$B$7,SMALL(IF($D$1=$A$2:$A$7,ROW($A$2:$A$7)-ROW($A$2)+1),1+(ROW(A1)-1))), "") + Ctrl + Shift + Enter
      • To post as a guest, your comment is unpublished.
        Warthogb · 2 years ago
        Crystal, Many many thanks, have only had a chance today 27/8/48 to see your help, will do formula later today :)
  • To post as a guest, your comment is unpublished.
    Ferdhy · 2 years ago
    =Sumproduct(((A2:A6)=D1)*((B2:B6)=Max(B2:B6))*(B2:B6))
    • To post as a guest, your comment is unpublished.
      Nithin · 2 years ago
      [quote name="Ferdhy"]=Sumproduct(((A2:A6)=D1)*((B2:B6)=Max(B2:B6))*(B2:B6))[/quote]
      i appreciate your help FERDHY. i tried out the formula , but since max(B2:B6) is 500 (orange), the value i get is 0.
      • To post as a guest, your comment is unpublished.
        Ferdhy · 2 years ago
        Hi,
        Just use this =SUMPRODUCT(MAX(((A2:A8)=D1)*(B2:B8)))
        once you change in D1 and put Banana, you should get 300 , if you put Orange, you will get 500.

        Ferdhy
        • To post as a guest, your comment is unpublished.
          Rita · 2 years ago
          You can also use:
          =max(if(A2:A6=D1, B2:B6)) + Ctrl + Shift + Enter
  • To post as a guest, your comment is unpublished.
    Nithin · 2 years ago
    How to find the maximum value of Bananaa
  • To post as a guest, your comment is unpublished.
    Nithin · 2 years ago
    Help me to find the maximum value of Bananaa using a formula . Ie to display 300
  • To post as a guest, your comment is unpublished.
    Dynes · 2 years ago
    If the value result is #NUM! could you please show me the formula to add so it will return to ZERO result.

    Thank you
    • To post as a guest, your comment is unpublished.
      alan · 2 years ago
      Just add IFERROR(your formula, the result you want to return), for example, the formula is =sum(A1:A6), then it would convert to =IFERROR(sum(A1:A6),""), it will return blank if the result is error like #NUM!.
  • To post as a guest, your comment is unpublished.
    MT · 2 years ago
    What if the banana can be yellow or green, how can we use this formula to show the right quantity based on two values (instead of one just now)? Thanks for your help!
  • To post as a guest, your comment is unpublished.
    Danish · 3 years ago
    Thank you so much!!!
  • To post as a guest, your comment is unpublished.
    EKTA SINGH · 3 years ago
    Hi

    Can you provide the video for the above mentioned formula to fatch the 2nd ,3rd value of the data