Iago Losada Alibune
Iago Losada Alibune

Reputation: 47

How I turn multiple columns into two columns?

I have a sales SpreadSheet that is divided in columns per month and I need to turn the months into columns with the sales values.

I've made an example sheet

Example Sheet

I have the data in this model:

enter image description here

and I need to turn it into this model:

enter image description here

There is a way to do this with formulas or script?

I've tried to use Pivot Table and Transpose but didn't work as expected.

Upvotes: 1

Views: 182

Answers (1)

player0
player0

Reputation: 1

try:

=ARRAYFORMULA({"PRODUCT"\ "MONTHS"\ "SALES"; 
 SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(
 IF(B2:G9<>""; "♠"&A2:A9&"♦"&B1:G1&"♦"&B2:G9; );;999^99));;999^99); "♠")); "♦")})

0

Upvotes: 2

Related Questions