我想知道我是否有办法只为我的公式选择单词的开头(见下文)
=IFERROR(IF($Q1="ALLN",IF(OR($S1="NATIONSTAR"),"X",""),""),"")
“NATIONSTAR”在我的电子表格中有不同的形式,所以我只需要选择“NATIONSTAR”这个词以及之后可以跟随的所有内容,例如“NATIONSTAR / BLANK”和“NATIONSTAR / BALNK”有这个差距
答案 0 :(得分:0)
使用SEARCH:
=IFERROR(IF($Q1 = "ALLN",IF(ISNUMBER(SEARCH("NATIONSTAR",$S1)),"X",""),""),"")
答案 1 :(得分:0)
您可以使用LEFT
功能仅选择最左侧的x个字符:
=IFERROR(IF($Q1="ALLN",IF(OR(LEFT($S1,10)="NATIONSTAR"),"X",""),""),"")
您的OR
函数在单个值上运行是多余的,因此可以简化为:
=IFERROR(IF($Q1="ALLN",IF(LEFT($S1,10)="NATIONSTAR","X",""),""),"")
然后你可以将两个测试与AND
结合起来,给出:
=IFERROR(IF(AND($Q1="ALLN",LEFT($S1,10)="NATIONSTAR"),"X",""),"")