Search code examples
google-sheetsgoogle-sheets-formula

How to use Column Value as header in Query in google sheet


enter image description here

I was trying use query to show results as below. But I couldn't figure out how to use Column A (months) as a header.

I knew how to use Vlook or Filter function to generate same results. Since my data is huge, I prefer to use Query function to keep my data flexible. Thank you for helping.

https://docs.google.com/spreadsheets/d/1ljrMdM4m0YT35EP7HxY-Gdj9SrEv6DHoQw_qL8Z9c-Y/edit?usp=sharing


Solution

  • Something like this should work, needs tweaking with ordering though.

    =query(Sheet1!A1:C71,"select B, sum(C) group by B pivot A")