Multiple regex matches in Google Sheets formula

后端 未结 5 2025
情歌与酒
情歌与酒 2020-12-01 17:08

I\'m trying to get the list of all digits preceding a hyphen in a given string (let\'s say in cell A1), using a Google Sheets regex formula :

=R         


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 17:41

    I wasn't able to get the accepted answer to work for my case. I'd like to do it that way, but needed a quick solution and went with the following:

    Input:

    1111 days, 123 hours 1234 minutes and 121 seconds
    

    Expected output:

    1111 123 1234 121
    

    Formula:

    =split(REGEXREPLACE(C26,"[a-z,]"," ")," ")
    

提交回复
热议问题