Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular expressions in excel formulas [duplicate]

TL;DNR: does excel formulas provide regex-like functionalities for pattern matching?

My task is to extract the numeric values from strings (containing addresses in this specific case). Solving the problem with VBA's regular expressions would be pretty straightforward, but unfortunately I would prefer not to use it.

Does excel formulas provide pattern matching functionalities with similar expressiveness? SEARCH seems to be pretty limited, and in order to work it needs to exploit regularities that, since the text is user-submitted, I can't really rely on.

like image 692
mercuk Avatar asked Oct 15 '16 14:10

mercuk


People also ask

How do you repeat a regular expression?

An expression followed by '*' can be repeated any number of times, including zero. An expression followed by '+' can be repeated any number of times, but at least once. An expression followed by '? ' may be repeated zero or one times only.

How do I get a formula to repeat in Excel?

Simply do the following: Select the cell with the formula and the adjacent cells you want to fill. Click Home > Fill, and choose either Down, Right, Up, or Left. Keyboard shortcut: You can also press Ctrl+D to fill the formula down in a column, or Ctrl+R to fill the formula to the right in a row.

Can I use regex in Excel filter?

Regex allows you to do advanced sorting and filtering. The SeoTools plugin for Excel supports regex, but it — like most cool resources for Excel — is PC-swim only. For those of us red-headed stepchildren Mac […]


1 Answers

There's no regex available in Excel formulas. Your best option is to create a function in VBA and then call it from Excel

Link explaining how to do it.

like image 84
Kritz Avatar answered Oct 13 '22 01:10

Kritz