Google-sheets – Split text with Google Sheets

google sheets

I have a Google Sheets with 1,500 cells containing items like:

1,300 users  
2236 users, 12 companies  
15000 users,153 companies  
<46,000 users, <200 companies  

I need to split this content into two columns that would look like:

1300  
2236      12
15000     153
46000     200

Commas don't succeed as the delimiter in a simple SPLIT() function, nor does spacing.

Any ideas what I can do here?

Best Answer

You can use a quite pragmatic approach to reach your goal.

Formula

=ARRAYFORMULA(
   SPLIT(                        // string
     REGEXREPLACE(
       A1:A4,                    // text
       "[users,<=>compani]",     // regular_expression
       ""                        // replacement
     ),                          
   " ")                          // delimiter
 )

copy/paste
=ARRAYFORMULA(SPLIT(REGEXREPLACE(A1:A4, "[users,<=>compani]",""), " "))

Screenshot

enter image description here

Explained

The regular_expression is cleaning up the string, in preparation for the SPLIT. The replacement is simply set to contain an empty string. The result, yields a string that contains one or two values, separated by a white space. The delimiter in the SPLIT is set accordingly and all is put into an ARRAYFORMULA.