跳到主要内容

如何在Excel中创建自己的搜索框?

除了使用Excel中的“查找”功能外,实际上,您可以创建自己的搜索框以轻松搜索所需的值。 本文将详细介绍两种在Excel中创建自己的搜索框的方法。

使用条件格式创建自己的搜索框,以突出显示所有搜索结果
用公式创建自己的搜索框以列出所有搜索结果


使用条件格式创建自己的搜索框,以突出显示所有搜索结果

您可以执行以下操作,使用Excel中的条件格式设置功能创建自己的搜索框。

1.在搜索框中选择包含您要搜索的数据的范围,然后单击 条件格式 > 新规则 在下面 主页 标签。 看截图:

2.在 新格式规则 对话框,您需要:

2.1)选择 使用公式来确定要格式化的单元格 在选项 选择规则类型 框;

2.2)输入公式 = ISNUMBER(SEARCH($ B $ 2,A5))格式化此公式为真的值 框;

2.3)点击 格式 按钮为搜索值指定突出显示的颜色;

2.4)点击 OK 按钮。

:

1.在公式中,$ B $ 2是一个空白单元格,您需要将其用作搜索框,而A5是您需要在其中搜索值的所选范围内的第一个单元格。 请根据需要更改它们。

2.该公式不区分大小写。

现在创建了搜索框,当在搜索框B2中键入搜索条件并按Enter键时,将搜索出指定范围内的所有匹配值并立即将其突出显示,如下面的屏幕截图所示。


用公式创建自己的搜索框以列出所有搜索结果

假设您有一个需要搜索的数据列表位于E4:E23范围内,如果要在使用自己的搜索框搜索后在另一列中列出所有匹配的值,可以尝试以下方法。

1.选择一个与单元格E4相邻的空白单元格,这里我选择单元格D4,然后输入公式 = IFERROR(SEARCH($ B $ 2,E4)+ ROW()/ 100000,“”) 进入编辑栏,然后按 输入 键。 看截图:

备注:在公式中,$ B $ 2是您需要将其用作搜索框的单元格,E4是您需要搜索的数据列表的第一个单元格。 您可以根据需要更改它们。

2.继续选择单元格E4,然后将“填充手柄”向下拖动到单元格D23。 看截图:

3.现在选择单元格C4,输入公式 = IFERROR(RANK(D4,$ D $ 4:$ D $ 23,1),“”) 进入公式栏,然后按 输入 键。 选择单元格C4,然后将“填充手柄”向下拖动到C23。 看截图:

4.现在,您需要用序列号填充范围A4:A23,序列号从1到1增加20,如下图所示:

5.选择一个需要显示搜索结果的空白单元格,输入公式 = IFERROR(VLOOKUP(A4,$ C $ 4:$ E $ 23,3,FALSE),“”) 进入公式栏,然后按 输入 键。 继续选择单元格B4,将“填充手柄”向下拖动到B23,如下图所示。

从现在开始,当在搜索框B2中输入数据时,所有匹配的值都将列在范围B4:B23中,如下图所示。

备注:此方法不区分大小写。

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (29)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
me pueden apoyar en cual es la formula para solo buscar
porfa
This comment was minimized by the moderator on the site
Hi, for the second part: "Create Your Own Search Box With Formulas To List All Searched Results", it doesn't say what to do with the search box, my search box has no formula in it. I am trying to do it with multiple columns as well, does it work too?
This comment was minimized by the moderator on the site
Insert data from example. Copy formula in indicated cell, but delete space from formula. Easy!
This comment was minimized by the moderator on the site
i have tried using this but is dose not wont to highlight the box I am searching for why is this
This comment was minimized by the moderator on the site
Can you create a formula that captures two cells worth of information in retrospect i am using a set up that captures user names and badge data so i need it to when it filters that it carries both cells of information not just one
This comment was minimized by the moderator on the site
hi! I used the basic highlight search bar, but am having a couple of issues. it is predicting my search and finding it with no issues... however, it always highlights the cell a couple below or above the searched one. Are you able to help me with this please?
This comment was minimized by the moderator on the site
Hi! Is this applicable to Google Sheets? I'm trying to make a search box with formulas to list all searched results. I followed every steps listed above but the results shows nothing. There is an error tho, it says "change Iterative calculation". But whatever I do, it doesn't show anything - just blank. Can you help me with this, please... Thank you!
This comment was minimized by the moderator on the site
Good day,
This is only applicable to Microsoft Excel application. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Hi! Is this applicable to Google Sheets? I'm trying to make a search box with formulas to list all searched results. I followed every steps listed above but the results shows nothing. There is an error tho, it says "change Iterative calculation". But whatever I do, it doesn't show anything - just blank. Can you help me with this, please... Thank you!
This comment was minimized by the moderator on the site
Hello, I am using to search between my vendors (one column) and brands (another column). With this setup, there are brands (like Microsoft) that can have more vendors (vendor A, vendor B, vendor C,...). I would like to search for the brand (microsoft) name and would like to see all possible vendors (A, B & C as well). But now the result is only the first vendor and that's all. How can I change/fix that?

Many thanks!
This comment was minimized by the moderator on the site
Hi Tomas,
Maybe you can rearrange your data and create a dynamic drop down list to solve the problem. You can browse the below article for more details.
https://www.extendoffice.com/documents/excel/1350-excel-create-dynamic-drop-down-list.html
This comment was minimized by the moderator on the site
i followed the resulted search method and it worked perfectly however the results are hyperlinked and it shows me the result without the hyperlink is there a way i can make it show me the result with the link connection?
This comment was minimized by the moderator on the site
After entering the formula =ISNUMBER(SEARCH($B$1,A4)) for conditional formatting, if the cell I used for the search function is blank, all the cells that are searched (A4:C368) are highlighted. But once a string is entered for the search criteria the cells containing the search criteria are highlighted correctly. Is there a way to tweak the formula to not highlight until search criteria is entered? Or did I do something wrong?

Also, using the formula in step 5 on another sheet within the workbook isn't working. What I'm trying to do is perform a search and show results of that search on one sheet named Search & Results while having the information to be searched on a sheet named Index. The formula I'm using is =IFERROR(VLOOKUP(A3,Index!$A$4:$C$368,5,FALSE),"") where A3 is the beginning of my numbered cells on the Search & Results sheet and the search is taking place throughout cells A4:C368 on the Index sheet.
This comment was minimized by the moderator on the site
same had been having the same issue with the formula,try this in your conditional formatting rule "=AND($I$1<>"",ISNUMBER(SEARCH($I$1,$B4)))", it works for me
I1 is my search box, B4 is first cell of selected range
This comment was minimized by the moderator on the site
Hi Colby. Your vlookup formula=IFERROR(VLOOKUP(A3,Index!$A$4:$C$368,5,FALSE),"") refers to range from A4 to C368 in Sheet name index which have only 3 column but you are entering 5 right after $C$368 which tells the vlookup formula to display value of column 5 which does not exists in your selected range. Fix this and I believe that your problem will be solved.
This comment was minimized by the moderator on the site
I have the same problem. Did you get an answer?
This comment was minimized by the moderator on the site
also me. i have the same problem
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations