I have a cell contains this value/text :

T50 EX3 OF2 BE40 BL10 ZLD6 ZLS2 ZRS10 AA1

How to get the number with the 'EX' prefix ? in this case i want to extract that '3' from EX3.

Also, this number can be any digit, for example it can be :




How to extract that '112' and '00078' and make it as number 112 and 78 ?

1 Answer 1


Try regexextract() like this:

=iferror( value( regexextract(A2, "\bEX(\d+)") ) )

The value() wrapper converts to number, and iferror() guards against cells that do not contain an "EX" sequence.

To learn the exact regular expression syntax used by Google Sheets, see RE2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.