简体   繁体   English

匹配/索引/ Vlookup公式

[英]Match/Index/Vlookup formula

Trying to create a formula to search 2 columns of text and return value in corresponding cell to the right...so, if I have 4 columns, A & C have text (AA, BB, CC, DD, etc) and columns B & D have numbers (1,2,3,4,etc), I want a formula to search the text of A & C and whichever column the text appears, return the value in B or D directly to the right. 尝试创建一个公式以搜索2列文本并在右侧的相应单元格中返回值...因此,如果我有4列,则A&C包含文本(AA,BB,CC,DD等),B列&D有数字(1、2、3、4等),我想要一个公式来搜索A&C的文本,无论文本出现在哪一列,都直接在B或D中返回值。 Hope this makes sense. 希望这是有道理的。

Assuming that the columns A & C have unique text and that there are no repetitions, you can use SUMIF : 假设A和C列具有唯一的文本并且没有重复,则可以使用SUMIF

=SUMIF(A:A,"AA",B:B)+SUMIF(C:C,"AA",D:D)

Otherwise, VLOOKUP would work too: 否则, VLOOKUP也可以工作:

=IFERROR(VLOOKUP("AA",A:B,2,0),VLOOKUP("AA",C:D,2,0))

EDIT: 编辑:

As per barry houdini's comment, you can use: 根据Barry houdini的评论,您可以使用:

=SUMIF(A:C,"AA",B:D)

for a shorter version of SUMIF . 对于较短版本的SUMIF

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM