如何在Excel中的子字符串之前和之后提取许多字符

发布于 2025-02-11 13:39:10 字数 162 浏览 1 评论 0原文

在AIN列中,每个单元格中都有一大堆文本墙,并且BI中希望看到围绕关键字“气候变化”的信息段,以更好地理解上下文。为此,我只想在关键字之前提取100个字符,然后在关键字之后再提取100个字符。

我尝试了通常的左,右,查找中间功能,但无法弄清楚如何指定我需要

任何帮助的字符数量,谢谢

In Column A I have a large wall of text in each cell, and in Column B I want to see a snippet of information around the keyword "Climate Change" to better understand the context. For that, I want to only extract 100 characters before the keyword, and another 100 characters after the keyword.

I tried the usual left, right, find, mid functions but couldn't figure it out how to specify the number of characters i need

any help is appreciated, thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

开始看清了 2025-02-18 13:39:10

= mid(a1,max(搜索(“气候变化”,a1)-100,1),214)

最大(x,1)在气候搜索之前没有100个字符时检查句柄,因为MID在起始位置参数小于1。

=MID(A1,MAX(SEARCH("climate change",A1)-100,1),214)

The Max(x,1) check handles when there aren't 100 characters before climate search, because Mid returns an error when the starting position parameter is less than 1.

绅士风度i 2025-02-18 13:39:10

您可以使用子函数。

=替换(a2,“气候变化”,“”)

如果要删除额外的空间,则使用trim

= trim(替换(a2,“气候变化”,“”))

You can use subtitute function.

=SUBSTITUTE(A2,"Climate Change","")

if you want to remove the extra spaces then use trim

=TRIM(SUBSTITUTE(A2,"Climate Change",""))

Example

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文