Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidfurlong/091fccce118fdf71fb15c7cc52244555 to your computer and use it in GitHub Desktop.
Save davidfurlong/091fccce118fdf71fb15c7cc52244555 to your computer and use it in GitHub Desktop.
extracts first continuous number from a cell in google sheets. Examples "abc 30,00" => 30, "fsdf 10 fsdf 20" => 10 "abc12fee" => 12, "abc 30.0" => 30
// Replace K2:K with your column letter and 2 with the row number of the current row. You only need to insert this into one cell in the column.
=ARRAYFORMULA(IF(ISERROR(regexextract(K2:K,"[0-9]+")), "", regexextract(K2:K,"[0-9]+")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment