You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:用Excel公式提取字符串中第二个"左侧1-5位的测量值

Extract the Second Measurement Value in Excel

Got it, let's solve this problem of grabbing that second measurement value right before the second double quote. Your current formula works great for the first one, so let's build on that logic with a few tweaks tailored to your string structure.

The Reliable Formula for Your String Structure

Since your examples follow the pattern [Measurement1]"BW x [Measurement2]"BW, we can leverage the "x " separator to pinpoint the second measurement easily. Here's the formula:

=TRIM(MID(D48,FIND("x",D48)+1,FIND(CHAR(34),D48,FIND("x",D48))-FIND("x",D48)-1))

Breakdown of How It Works

Let's walk through each part so you understand what's happening:

  • FIND("x", D48): Locates the position of the "x" that separates the two measurements.
  • FIND("x", D48)+1: Moves past the "x" to the start of the space/characters leading to the second measurement.
  • FIND(CHAR(34), D48, FIND("x", D48)): Finds the second double quote (starting the search after the "x" to avoid the first quote).
  • MID(...): Extracts the substring between the end of the "x" and the second double quote.
  • TRIM(): Cleans up any extra spaces that might be around the measurement value.

Testing with Your Examples

  • For 2"BW x 1"BW, the formula returns 1
  • For 2-1/2"BW x 1-1/2"BW, it returns 1-1/2

If You Need to Handle Edge Cases

If there's ever variation in the separator (like multiple spaces around "x"), this formula still works because TRIM() takes care of extra whitespace. If your string structure changes slightly, just adjust the FIND("x", D48) part to match the new separator.

内容的提问来源于stack exchange,提问作者Richard G

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:27:29