I’m working on a Google Sheets project and I need some help with the REGEXTRACT function. I want to pull out a number like 4.148 from cell B13. The tricky part is that this number changes over time so I can’t just copy it directly.
I tried using REGEXTRACT but I’m getting an error about the parameters not matching up. I’m pretty new to Google Sheets so I’m not sure what I’m doing wrong.
Here’s what my sheet looks like:
A B
1 Name Value
...
13 Total $4.148 million
I want to get just the 4.148 part from B13. Any ideas on how to make this work? Thanks for any help!
Hey Luna23, I’ve dealt with similar issues in my work. Here’s what I found effective:
Use this formula: =REGEXEXTRACT(B13, “\d+.?\d*”)
It extracts numbers with or without decimal points. The “\d+” part matches one or more digits, “.?” optionally matches a decimal point, and “\d*” matches zero or more digits after the decimal.
If you need the result as a number instead of text, wrap it in VALUE():
=VALUE(REGEXEXTRACT(B13, “\d+.?\d*”))
This approach has worked well in my projects where data formats vary. Give it a try and let me know if you need any clarification!
To extract the numeric value from cell B13, you can use a combination of REGEXEXTRACT and VALUE functions. Here’s a formula that should work:
=VALUE(REGEXEXTRACT(B13, “\d+.\d+”))
This regex pattern “\d+.\d+” looks for one or more digits, followed by a decimal point, and then one or more digits. The VALUE function converts the extracted string to a number.
If you want to handle cases where there might not always be a decimal point, you could use:
=VALUE(REGEXEXTRACT(B13, “\d+(.\d+)?”))
This will work for both whole numbers and decimals. Hope this helps with your project!
it’ll grab ur number whether its got decimals or not. just copy-paste into a cell and point it at B13. should do the trick! lemme know if u need anything else