2

I'm using a Google Sheets and trying to create a formula to remove a period and anything that comes before it in a cell. For example:

idontwantthis.iwantthis

I have used this in the past:

=(RIGHT(D2,FIND("whatever characters here",D2,1) - 1))

but the period "." is a wildcard. I have googled around for a few hours and still have nothing that works. Any insight would be awesome!

migrated from superuser.com Mar 23 '13 at 8:21

This question came from our site for computer enthusiasts and power users.

4

You just need to use the backslash to escape the period character, so you have one of two options:

for regexextract to capture everything after the period, thus ignoring everything before it:

=REGEXEXTRACT(A1,"\.(.*)")

or regexreplace to replace everything including and before the period:

=REGEXREPLACE(A1,"(.*\.)","")
1

The following formula will split the result, using a "." as delimiter and show only the last column:

=INDEX(SPLIT(A1;"."),1,2)

If there are more "." involved, then use this formula:

=INDEX(SPLIT(A1;"."),1,LEN(A1)-LEN(SUBSTITUTE(A1,".",""))+1)
1

A formula is not necessarily required, simply Find (Edit > Find and Replace...):

.+\.

with nothing (leave Replace blank) and Search using regular expressions checked should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy