Horizontally Flip a Range

The SORT and TRANSPOSE functions will be used here to horizontally reverse the columns of a cell range.


Example of Use

The objective is to display the same table on the right but with an inversion of the columns:

google sheets table to copy invert range horizontally

To reverse the columns, use the following formula (which will be detailed further below):

=TRANSPOSE(SORT(TRANSPOSE(A1:D15),ROW(A1:A4),0))

google sheets range column inversion transpose sort invert horizontally

Explanation of this Formula

The SORT function sorts the rows of a table and not the columns, so it is necessary to start by using the TRANSPOSE function to invert rows and columns:

=TRANSPOSE(A1:D15)

google sheets table transpose png invert range horizontally

From there, you can vertically invert the rows using the SORT function (see the page on vertical inversion of rows to understand its operation before proceeding).

Enter in the ROW function a range of any width of one column and with a number of rows equal to the number of columns of the range to be inverted (here, 4 columns to invert):

=SORT(TRANSPOSE(A1:D15),ROW(A1:A4),0)

google sheets table transpose sort png invert range horizontally

The rows are now inverted.

All that remains is to invert rows and columns again using the TRANSPOSE function to get the desired result:

=TRANSPOSE(SORT(TRANSPOSE(A1:D15),ROW(A1:A4),0))

google sheets range column inversion transpose sort invert horizontally

If needed, you can copy the Google Sheets document (or view the document) with this example.