Home > Net >  Trying to display first two numerical numbers
Trying to display first two numerical numbers

Time:09-08

I am trying to parse this so the numbers before "-" are displayed only. Sometimes it will be a single digit and sometimes double.

I tried =LEFT(B4,FIND("-",B4)-1)

And it shoots an error. image of error

CodePudding user response:

try:

=REGEXEXTRACT(TO_TEXT(B4); "(\d )")*1

for array:

=INDEX(IFERROR(REGEXEXTRACT(TO_TEXT(B4:B); "(\d )")*1))

update:

=INDEX(IFERROR(REGEXEXTRACT(TO_TEXT(C1:C), "^(\d )")*1))

enter image description here

  • Related