LibreOffice Calc - Find the Position of First Numeric Character in a Text String -


i have this:

fghs13412asdf

dfs234245gk

.

want return position of last numeric character, so:

5

3

.

i've tried many things, nothing working. perhaps different in libreoffice excel, i'm seeing examples. here's 1 should straightforward, , returning in error: https://www.youtube.com/watch?v=joza6-cjyic

do need position of first numeric character (as in heading) or of last 1 (as in body of question)?

  1. if it's first one, simple search() function using regular expressions should trick, e.g. =search("([:digit:])";a1).

  2. if it's last one, counted start of string, can use different regex (adapted an answer in openoffice forums gerard24): =search("[0-9][^[0-9]]+$";a1).

  3. if need position of last numeric character, counted end of string, subtract value calculated in step 2 len() of entire string: =len(a1)-(search("[0-9][^[0-9]]+$";a1)).

you'll #value! error if there's no numeric character, or if last character of input string numeric. note whitespace in string ignored:

enter image description here


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -