在两列中匹配值,并使用vlookup从Excel中的第三列返回值 [英] Match values in two columns and return value using vlookup from third column in Excel

查看:497
本文介绍了在两列中匹配值,并使用vlookup从Excel中的第三列返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作表(称为FINAL),其数据类似如下:

I have a worksheet (called FINAL) with similar data as below:

    A        B      C 
  Year   Month  Births  
  1880     1     530  
  1880     2     456  
  1880     3     234     
  1890     1     163     
  1890     2     123     
  1890     3     125 

第二个电子表格:

   A       B      C      D
  Year   Month  Births  
  1880     1        
  1890     2               
  1890     3

我希望在第2页的A列中找到一个值1880从表2中,在第1列A中,然后在满足特定月份标准时返回D中的值,例如1880(A)和1(B)然后在列D中返回530

I wish to look for mach for a value from column A in sheet 2 e.g. 1880 from sheet 2, in sheet 1 column A then return a value in D when it meets a specific month criteria e.g. 1880(A) and 1(B) then return 530 in Column D

我写的这个公式不给我任何东西(放回NA)

This formula I wrote does not give me anything (gives back NA)

=IF(IF(A2=Final!B12,TRUE,FALSE),TRUE,VLOOKUP(Final!A2,Final!B12:C3532,2,FALSE))

对我来说,逻辑是,如果A2 = B2是TRUE,那么外部如果得到一个TRUE如果它是真的,然后执行Vlookup并返回第二列的值else false),但它不起作用

To me the logic is, if A2=B2 is TRUE then outer if gets a TRUE and if its true then do the Vlookup and return the value in second column else false) but it doesn't work

推荐答案

你需要把逻辑放在查找中。

You need to put the logic in the lookup.

=INDEX(Final!$C$1:$C$500(MATCH(1,IF(A2=Final!$A$1:$A$500,IF(B2=Final!$B$1:$B$500,1,0),0),0))

这是一个数组公式,当退出编辑模式而不是Enter时,需要使用Ctrl-Shift-Enter进行确认。

This is an array formula. It needs to be confirmed with Ctrl-Shift-Enter when exiting edit mode instead of Enter.

这篇关于在两列中匹配值,并使用vlookup从Excel中的第三列返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆