Home > Net >  Why does multiplying REGEXEXTRACT value return incorrect results?
Why does multiplying REGEXEXTRACT value return incorrect results?

Time:09-28

I want to pull a the first line of date from a particular cell - in this case BO17 - and then multiply it by 25. You see I have the REGEXEXTRACT formula, which I have attempted to place into a larger multiplication formula. However, every time I run this, the result is 25, as opposed to 84(25).This is my current function.

=PRODUCT((REGEXEXTRACT(BO17, "[0-9] ")),25)

CodePudding user response:

try:

=PRODUCT(REGEXEXTRACT(BO17, "[0-9] ")*1, 25)

or just:

=REGEXEXTRACT(BO17, "[0-9] ")*25

CodePudding user response:

This is because REGEXEXTRACT returns TEXT type. You need to convert it to number.

=PRODUCT(--REGEXEXTRACT(BO17, "[0-9] "),25)
  • -- The double unary operator can be used to convert TEXT to NUMBER type
  • Alternatively, you can use VALUE() function
  • Related