Skip to main content

Finding Units from Product Name Field

  • November 18, 2023
  • 1 reply
  • 15 views

Forum|alt.badge.img

I have a field which contains product names with measurement unit in the same field.

"Product Name 100grams" or "Product Name 500ml"

I want to create a formula to extract 100grams or 500ml (these measurement units need not to be in the last place of the field.

Is there any way to grab these units?

1 reply

Forum|alt.badge.img+21
  • Inspiring
  • November 18, 2023

This formula returns a string consisting of the last word of the product name with the numerical value removed.
If the last word does not contain a numeric value, nothing is returned.

IF( REGEX_MATCH({Name}, ".* [\\d.,]+(.*$)"), REGEX_EXTRACT({Name}, ".* [\\d.,]+(.*$)") )