excel搜索多个项目 [英] excel search for multiple items

查看:131
本文介绍了excel搜索多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在单元格中搜索多个项目。如果我正在寻找任何一个术语,我想要单元格D显示笔记本电脑,否则显示桌面。我可以得到以下的工作,只需一个字词来搜索:

I am trying to search for multiple items in a cell. If any of the terms I am looking for is present, I want cell D to display "Laptop", otherwise, display "Desktop". I can get the following to work, with just one term to search for:

= IFERROR(IF(SEARCH(blah,A2),Laptop ),桌面)

=IFERROR(IF(SEARCH("blah",A2),"Laptop",""),"Desktop")

但是我想搜索blah,blah2和blah3的存在。我不知道如何让Excel搜索以下任何术语。 (不是所有的人都记住你,只是以下任何一个。

But I want to search for the presence of blah, blah2, and blah3. I don't know how to get Excel to search for any of the following terms. (Not all of them mind you, just any of the following.

我确实看到有一个逻辑的选项。

I did see that there is an or option for the logic.

= OR(第一个条件,第二个条件,...等)

=OR(first condition, second condition, …, etc.)

我不知道如何让这两个人一起工作关于如何让他们显示笔记本电脑的想法,如果有任何词出现?

I am not sure how to get these two to work together. Any thoughts on how to get them to display "Laptop" if any of the words are present?

推荐答案

这应该工作: p>

This should work:

=IF(SUM(COUNTIF(A2,"*" &{"blah1";"blah2";"blah3"}& "*"))>0,"laptop","desktop")

这篇关于excel搜索多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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