简体   繁体   English

当 A 列中的所有 3 个条件都满足时,仅将 B 列中的项目输出到 C 列

[英]Output only items from Column B to Column C when All 3 conditions are met in Column A

I have two columns, one with account types (-A -B -C -D -E, etc) I only want Column B to be output into Column C if the account holder from Column B has all three account types (-A -B and -C)我有两列,一列有账户类型(-A -B -C -D -E 等)如果 B 列的账户持有人拥有所有三种账户类型(-A - B 和 -C)

Objective: Output Row from Column B into Column C IF Column A ends with -A, -B and -C目标:将列 B 的行输出到列 C IF 列 A 以 -A、-B 和 -C 结尾

Here is what I have tried:这是我尝试过的:

=IF(RegExMatch(A2:A,"-A") AND (RegExMatch(A2:A,"-B") AND (RegExMatch(A2:A,"-C"),"$ColumnB","No Output")

Clearly does not work and I am terrible with Google Sheets.显然不起作用,我对谷歌表格很糟糕。

输出

You can use VLOOKUP instead REGEXP and you can build your search string with CONCATENATE您可以使用VLOOKUP代替REGEXP并且可以使用CONCATENATE构建搜索字符串

Sample:样本:

=IF(AND(VLOOKUP(CONCATENATE(B2,"-A"), A$2:A, 1, false)<>"", VLOOKUP(CONCATENATE(B2,"-B"), A$2:A, 1, false)<>"", VLOOKUP(CONCATENATE(B2,"-C"), A$2:A, 1, false)<>""), B2, "No output")

use:用:

=ARRAYFORMULA(IF(REGEXMATCH(LOWER(A2:A), LOWER("-a$|-b$|-c$")), 
 REGEXEXTRACT(A2:A, "(.*)-"), ))

0

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

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