简体   繁体   English

在Excel单元格中查找单词和其他字符

[英]Find word plus additional characters in Excel cell

I have an excel sheet with text in a cell - I'd like to extract the specific text and an additional 5 characters alongside it. 我有一个Excel表格,该表格的单元格中有文字-我想提取特定文字和旁边的5个字符。

For example: 例如:

Cell A1 contains the text - 'Here is the cell for widget 1A1A and its content'. 单元格A1包含文本-“此处是窗口小部件1A1A及其内容的单元格”。 I'd like to find any cell that contains the word 'widget' and extract that and the following 5 characters (including space). 我想找到任何包含单词“ widget”的单元格,并将其和以下5个字符(包括空格)提取出来。 So the result would be 'Widget 1A1A'. 因此,结果将是“小部件1A1A”。

This is quite straightforward. 这很简单。 Use the SEARCH command to find the word "widget" (FIND is the same but case-sensitive): 使用SEARCH命令查找单词“ widget”(FIND相同,但区分大小写):

=SEARCH("widget",A1)

This gives you the character number in the cell where the match is found [if no match is found it returns "#N/A". 这会在找到匹配项的单元格中为您提供字符编号[如果找不到匹配项,则返回“#N / A”。

Then match this with the MID function to pull in the text "Widget" + the following 5 characters, as follows: 然后将其与MID函数匹配,以输入文本“窗口小部件”和以下5个字符,如下所示:

=MID(A1,SEARCH("widget",A1), LEN("widget") + 5)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Excel查找单元格中的某些字符 - Find certain characters in cell with Excel 计算excel单元格中每个单词的字符数 - Count number of characters of each word in a cell in excel Excel:在单元格中找到一个单词,然后返回前一个单词和找到的单词 - Excel: find a word in a cell, then return the preceding word and the found word excel:从单词列表中查找单元格中的单词,然后返回该单词 - excel: Find a word in a cell from a list of word then return that word 在excel中查找单元格中重复单词的频率和位置 - Find the frequency and location of a recurring word in a cell in excel 每个段落中每个单词的平均字符数? 在excel单元格中 - The average number of characters per word in each paragraph? in an excel cell 使用 Excel 或 Google 电子表格公式为单元格中的每个单词添加加号 - Add a plus sign to every word in a cell using Excel or Google SpreadSheets formula Excel公式:查找一个单元格中的所有字符是否都在另一个单元格中,即使在另一个单元格中它们是更多字符 - Excel FORMULA: Find if all the characters in a cell are in another cell even if in this another cell they are more characters Excel:正则表达式可在“ /”字符之间找到第二,第三等单词 - Excel: Regex to find second, third, etc word in between “/” characters 在单元格文本的一部分中查找单词,返回列号:Excel VBA - Find word in part of cell text, return column number: Excel VBA
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM