When I enter data in a Google Spreadsheets cell, I would like the text to reverse itself.

For instance, I would like to put in a cell My text and get it converted to txet yM.

2 Answers 2


You will need to install and use a script to do it.

  1. In your spreadsheet, select ToolsScript GalleryInsert....
  2. Search for reverse. You should see String.reverse().
  3. Click Install, then Authorize.
  4. Close the Script Gallery.

To use the script, type =REVERSE(A1) where A1 is the cell with the text you want to reverse.

If you are using the new Google Sheets, the Script Gallery is not available. You will need to create your own custom function.

  1. Select ToolsScript editor...
  2. Select Blank project
  3. Replace the code with:

     * Reverses the input text.
     * @param {string} input The text to reverse.
     * @return The input text reversed.
     * @customfunction
    function REVERSE(string) {
      if (typeof string != 'string') {
        return null;
      return string.split('').reverse().join('');
  4. Save, return to your spreadsheet, and use =REVERSE(A1) as described above.

  • jep works fine - only running on 10000-s of lines of data gives an error because invoked too often
    – snh_nl
    Dec 30, 2017 at 13:53
  • @snh_nl see my answer below that doesn't require usage of a script (=no invoked too often error)
    – jan-glx
    May 18, 2021 at 13:34

As Ben Collins writes in his Blog you can extract all letters and concatenate them in reverse order using an ArrayFormula without any script:

Use =ArrayFormula(concatenate(MID(A1,LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))+1,1)) to reverse the content of A1.

This will not trigger your Google apps limits as easily as the script solution.

example -> example sheet


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.