How to convert text containing '2x10kg' or '6x1000gr' to a number (20 and 6000)

I have CELLS containing the textual artikel amount. I want to convert this text to a number. So ‘2x10kg’ should be converted to 20 and ‘6x1000’ converted to 6000

How can I do this?

Hallo

=PRODUCT(REGEX(A1;"\d+";;SEQUENCE(2))*1)

ps.: the SEQUENCE(…) function was introduced with LO24.8

Another approach would be converting the textual content inplace directly to a Formula, via:
Find and replace

  • search (\d+)x(\d+).*
  • replace =$1*$2
  • [x]regular Expression
  • [x]Selection only ⇒⇒Replace All
1 Like

Great, it works! Thanks!