Find and replace

The find and replace tool lets you quickly search within a document or spreadsheet, and it gives you the option to replace those terms with another.

Find and replace in a document

Desktop

To get started, go to the Edit menu and select Find and replace.... Then, type the word in the text box next to 'Find,' and click Next.

find replace

Or you can use one of these options:

  • Match case: Select this to search for words that match the exact case you type in.
  • Previous word: Click this button to find the previous instance of a word or term in your document.

If you want to find a word but aren't interested in any of the other options, you can access a simpler Find box by pressing Ctrl+F (Command+F on a Mac).

How to replace terms

  • To replace a word or expression in your document, type the text you'd like to replace in the box next to 'Replace with' and then click the Replace button.
  • If you'd like to replace all the selected words, click the Replace all button.
Android
  1. Open the document.
  2. Touch the Menu icon .
  3. Touch Find and replace.
  4. Type in the word you want to replace in the “Find” text box at the top.
  5. Touch Enter .
  6. Scroll through all instances of the word using the arrows at the top of the screen.
  7. If you want to replace the word, type the replacement into the “Replace with” text box at the bottom.
  8. Touch Replace to switch the words for one instance in the document. Touch All to replace all instances of the word in the text.
  9. Touch back on the document to continue editing.
iOS
  1. Open the document.
  2. Touch the Menu icon .
  3. Touch Find and replace.
  4. In the top left, type the word you want to replace in the “Search text” box.
  5. Touch Search.
  6. Scroll through all instances of the word using the arrows at the top of the screen.
  7. If you want to replace the word, type the replacement into the “Replace with” box in the top-right.
  8. Touch Replace to switch the words for one instance in the document. Touch All to replace all instances of the word in the text.
  9. Touch the in the top left to continue editing.

Find and replace in a spreadsheet

Desktop

If you're simply looking to find something within a spreadsheet, press Ctrl + F (⌘ + F on a Mac) and type a word or phrase you'd like to find. As you type, your search term will be highlighted everywhere it appears in the currently active sheet. If multiple results are found in your document, you can jump to the next one by pressing the down arrow in the find bar, or by pressing Enter. Pressing Shift + Enter, or clicking the up arrow, will take you to the previous result.

If you're looking for a more powerful way to search, use the find and replace tool, which lets you find certain terms within a spreadsheet and gives you the option to replace those terms with other terms. To get started, go to the Edit menu and select Find and replace. (You can also press Ctrl + H, or ⌘ + Shift + H on a Mac.) Then, type the word in the text box next to 'Find,' and click Find.

Google Docs find and replace dialog box

Use the drop-down option to search for terms in the current sheet, all sheets, or a specific range of cells. If you're using the old Google Sheets, you can't search a specific range but you'll see an option to Search all sheets.

Or you can use one of these options:

  • Match case: Select this to make your search case-senstive.
  • Match entire cell contents: Select this to search for cells that match your search term exactly. With this option checked, searching for "do," for example, will not return a cell in your spreadsheet containing "dog."
  • Search using regular expressions: Select this to use advanced searching capabilities, allowing you to search for cells that match a pattern.
  • Also search within formulas: Select this to extend your search to include formulas that match your search term (new Google Sheets only)

How to replace terms

  • To replace a word or expression in your document, type the text you'd like to replace in the box next to 'Replace with' and then click the Replace button.
  • If you'd like to replace all the selected words, click the Replace all button.

Using regular expressions to search for data in your spreadsheet

Regular expressions provide a way to search for strings of text, including particular characters, numbers, words, or patterns of characters. Regular expressions are particularly useful in pattern matching, as these searches are not restricted to a specific search term. Instead, searches return patterns that match the expression specified.

To use regular expressions in the Find and Replace function, type the expression into the Find box and select the "Search using regular expressions" checkbox.

Terms used in regular expressions

NOTE: Google products use RE2 for regular expressions, some of which are highlighted below. See all of the RE2 expressions and learn more about how to use them. Additionally, some of the examples listed below depend on the terms of the Find and Replace query. For instance, examples will behave differently if Match case is unchecked. Examples provided below demonstrate results when Match case is checked, and Match entire cell contents is not checked.

Expression Description Example Matches Does not match
. A period signifies any character in the given position. d. do, dog, dg, ads fog, jog
* An asterisk after a character signifies a search for that preceding character repeated 0 or more times. do*g dog, dg, dooog dOg, doug
+ A plus after a character signifies a search for that character displayed 1 or more times. do+g dog, dooog dg, dOg, doug
? The previous expression is optional. do?g dg, dog dOg, doug
^ A caret must be placed at the beginning of a regular expression and signifies that the string starts with the character(s) or sequence placed after the caret. ^[dh]og dog, hog A dog, his hog
$ A dollar sign must be placed at the end of a regular expression and signifies that the string ends with the character(s) or sequence placed before the dollar sign. [dh]og$ dog, hog, hot dog dogs, hogs, doggy
{A, B} The previous expression is repeated between A and B times, where A and B are numbers. d(o{1,2})g dog, doog dg, dooog, dOg
[x], [xa], [xa5] A character set indicates that just one of the given character(s) should occur in the current position. For the most part, any characters are valid within brackets, including characters mentioned previously in expressions: [xa,$5Gg.] d[ou]g dog, dug dg, dOg, dooog
[a-z] A character set range signifies a search for a character within the given range of characters. Common ranges include a-z, A-Z, and 0-9. Ranges can be combined into a single range: [a-zA-Z0-9]. Ranges can also be combined with character sets (mentioned previously): [a-zA-Z,&*]. d[o-u]g dog, dug, dpg, drg dg, dOg, dag
[^a-fDEF] A character set beginning with a ^ signifies a search for a character that is not within the given set. d[^aeu]g dog, dOg, dig, d$g dg, dag, deg, dug
\s Any white space character. d\sg d g, d[TAB]g dg, dog, doug

NOTE: When trying to search for actual instances of any character that has a specific meaning in regular expressions, like ^ and $, you need to "escape" the character in your search query by placing a backslash in front of it. For example, if you wanted to search for an instance of the $ character, you'd write \$.

Below are a couple of examples of how regular expressions could be used to search a spreadsheet:

Search for cells that contain dollar amounts

Enter the following in the Find bar: ^\$([0-9,]+)?[.][0-9]+

This signifies a dollar amount where the first number is any number 0-9 or comma occurring zero or more times, followed by [.], followed by any number 0-9 repeated one or more times. This search would return any of the following: $4.666, $17.86, $7.76, $.54, $900,001.00, $523,877,231.56

Search for cells containing US zip codes

Enter the following into the Find bar: [0-9]{5}(-[0-9]{4})?

This signifies a U.S. zip code consisting of five numbers with an optional hyphen and four-digit add-on.

Search for cells containing names beginning with a lowercase letter

Enter the following into the Find bar: ^[a-z].*

This signifies a cell input that contains a lowercase letter followed by another character 0 or more times. This search would return any of the following: bob, jim, gEORGE, marTin

Android

Find and replace

  1. Open the spreadsheet.
  2. Touch the Menu icon .
  3. Touch Find and replace.
  4. Type in the word you want to replace in the “Find” text box at the top.
  5. Touch Enter .
  6. Scroll through all instances of the word using the arrows at the top of the screen.
  7. If you want to replace the word, type the replacement into the “Replace with” text box at the bottom.
  8. Touch Replace to switch the words for one instance in the spreadsheet. Touch All to replace all instances of the word in the text.
  9. Touch back on the spreadsheet to continue editing.

Note: At the moment, find and replace in spreadsheets is only on desktop and Android devices.

Matt is a Docs & Drive expert and author of this help page. Leave him feedback below about the page.

How helpful is this article:

Feedback recorded. Thanks!
  • Not at all helpful
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful