在Excel中,是否有任何公式可以自动执行字符串中的等式相乘?

huangapple go评论51阅读模式
英文:

Is there any formula to automate multiplication with the equation within the string in Excel?

问题

给定的示例:

项目 件数
品牌A AA 6X5X40毫升 30
品牌B BB 24X20毫升 24
品牌C CC 2X12X20毫升 24
品牌D DD 20X2X2千克 40

是否有方法可以提取/自动化字符串内的方程式?请注意,有些项目没有乘法器,只有直接的数量。

我有5000多个项目,之前是手动一个一个地进行乘法运算。再次手动进行这个操作非常繁琐。

英文:

Given the example:

ITEM Quantity in Pieces
BRAND A AA 6X5X40ML 30
BRAND B BB 24X20ML 24
BRAND C CC 2X12X20ML 24
BRAND D DD 20X2X2KG 40

Is there any way that I can fetch/automate the equation in inside the string? Note that some items doesn't have any multiplier and just straight up quantity.

I have 5,000+ items and I did manually multiply them one by one. Its quite tedious to do it again manually.

答案1

得分: 3

=LET(x,TEXTSPLIT(A2,,{" ","X"}),PRODUCT(--FILTER(x,ISNUMBER(--(x)))))

要获得动态溢出数组的结果,请使用 MAP()BYROW()

=MAP(A2:A5,LAMBDA(lm,LET(x,TEXTSPLIT(lm,,{" ","X"}),PRODUCT(--FILTER(x,ISNUMBER(--(x)))))))

英文:

From your current sample you may try-,

=LET(x,TEXTSPLIT(A2,,{" ","X"}),PRODUCT(--FILTER(x,ISNUMBER(--(x)))))

To get results as dynamic spill array use MAP() or BYROW().

=MAP(A2:A5,LAMBDA(lm,LET(x,TEXTSPLIT(lm,,{" ","X"}),PRODUCT(--FILTER(x,ISNUMBER(--(x)))))))

在Excel中,是否有任何公式可以自动执行字符串中的等式相乘?

huangapple
  • 本文由 发表于 2023年2月8日 09:08:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75380483.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定