您的位置首页百科知识

excel 搜索多个关键字,如符合则返回指定文字,如没有则取前两位?

excel 搜索多个关键字,如符合则返回指定文字,如没有则取前两位?

你用的Excel可能是2003版,IF嵌套限制7层,公式可如下修脊含野改:=IF(SUM(COUNTIF(B2,{"*张*三*","*李*平*","*王*加*","*周*围*","*刘*宝*","*陈*动*","*黄*沙*","*汤*元*"})),LOOKUP(,0/COUNTIF(B2,{"*张*三*","*李*平*","*王樱喊*加*","*周*围*","*刘*宝*","*陈*动*"老握,"*黄*沙*","*汤*元*"}),"第"&{"一","二","三","四","五","六","七","八"}),LEFT(B2,2))