在MS Excel单元格中搜索多个文本字符串,并在找到时返回相同的字符串 [英] Searching for multiple text strings in a MS Excel cell and return the same string when found

查看:701
本文介绍了在MS Excel单元格中搜索多个文本字符串,并在找到时返回相同的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,在Excel单元格中,我有这些文本

For example, in Excel cells, I have these texts

A1您好吗,今天?"

A1 "Hi_how_are_you_today_?"

A2"I_am_doing_great"

A2 "I_am_doing_great"

A3您的工作场所一切都很好吗?"

A3 "everything good at you workplace?"

A4这些词都没有"

A4 "Doesn't have any of these words"

我正在寻找3个单词,分别为如何出色工作场所.在任何单元格中,如果找到这些单词中的任何一个,则它应返回相同的单词,否则应返回空白值.

I am looking for 3 words How, Great and workplace. In any cell if any of these words is found then it should return the same word, else it should a return blank value.

我能够在Excel上编写此公式,但是如果未找到任何这些值,它将返回#N/A错误. = IFS(ISNUMBER(SEARCH("How",A1))= TRUE,"How",ISNUMBER(SEARCH("Workplace",A1))= TRUE,"Workplace",ISNUMBER(SEARCH("great",A1)) = TRUE,很棒")

I was able to write this formula on Excel but it is returning #N/A error if any of these values aren't found. =IFS(ISNUMBER(SEARCH("How",A1))=TRUE,"How",ISNUMBER(SEARCH("Workplace",A1))=TRUE,"Workplace",ISNUMBER(SEARCH("great",A1))=TRUE,"great")

我们可以在此公式中进行一些更改吗,如果找不到任何更改,它将返回空白?

Can we make some changes in this formula so it will return blank if any of these is not found?

推荐答案

您也可以尝试

=IFERROR(INDEX({"how","great","workplace"},MATCH(TRUE,ISNUMBER(SEARCH({"how","great","workplace"},A1)),0)),"")

这篇关于在MS Excel单元格中搜索多个文本字符串,并在找到时返回相同的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆