简体   繁体   English

寻找结合列和行的Excel公式

[英]looking for excel formula combining columns and rows

Imagine a spreadsheet with 4 columns: ABCD 想象一下一个包含4列的电子表格:ABCD

If the B column is equal to D column, I want in column A the result of column C for example: if B2 is equal to D2, A2 value should be C2 value if not equal it should show empty or false or something 如果B列等于D列,我想在A列中获得C列的结果,例如:如果B2等于D2,则A2值应为C2值;如果不相等,则应显示为空或假或其他内容

I have uploaded a sample spreadsheet 我已经上传了一个示例电子表格

What is the formula to use? 使用什么公式?

In cell A2 , simply put: 在单元格A2 ,只需输入:

=IF(B2=D2,C2,FALSE)

And fill down for the other rows. 并填写其他行。

The logic should be simple enough to understand. 逻辑应该足够简单易懂。 And you can type in something else instead of FALSE if you want. 如果需要,您可以输入其他内容而不是FALSE

EDIT: 编辑:

As per amendment of problem: 根据问题的修正:

  1. First move the column D before column C (meaning Email will be in Column C and Log will be in column D) 首先将D列移到C列之前(这意味着电子邮件将在C列中,而Log将在D列中)
  2. In cell A2, put the formula =VLOOKUP(B2,C:D,2,0) 在单元格A2中,将公式=VLOOKUP(B2,C:D,2,0)
  3. Fill the formula down. 填写公式。

这将在A2中进行。

=IF(B2=C2,C2,"")

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

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