Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9786

Rearrange columns in Google Sheets

$
0
0

I have data in Google Sheets that I want to rearrange.

In each row, starting from the 4th column onwards, there are repeating column pairs of Favorite Fruit #& Favorite Color # where # indicates the index of the pair relative to other pairs. For example, Favorite Fruit 1 and Favorite Color 1 are followed by Favorite Fruit 2 and Favorite Color 2, etc.

  1. I would like to reorganize the data so that each column pair is in its row.
  2. The column pairs in all rows share the same two columns.
  3. The first three columns from the original row that contained a particular column pair are repeated on the new rows where that column pair is now located.

I can't figure out how to do it.

For example:

DateClassNameFruit 1Color 1Fruit 2Color 2
2/27/2024Class 1AliceAppleRedGrapesBlack

enter image description here

Would become:

DateClassNameFruitColor
2/27/2024Class 1AliceAppleRed
2/27/2024Class 1AliceGrapesBlack

enter image description here


Viewing all articles
Browse latest Browse all 9786

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>