Using more than one sheet for a pivot table in google sheet

I am trying to link three tables in Google Sheets using pivot table functionality.

Now the problem is that I can't find a way to pull data for multiple sheets. I can only use a pivot table with information coming from just one. I've researched quite a bit, but so far I can see that the documentation available for Google Docs isn't that extensive at some point.

Basically, I need to do the following:

Table 1 (main):

Vehicle name | ModelId | ColorID
ford | 1 | 1
fiat | 2 | 2

Table 2:
ModelID | name
1 | mustang
2 | Bravo

Table 3:
ColorID | name
1 | red
2 | Blue

Resulting pivot table:
Vehicle name | Model | color
ford | mustang | red
fiat | bravo | Blue

In SQL statements, I am mainly trying to mimic JOIN. I can also write a javascript script, but I would like to know if there is an easy way to achieve this without coding.

Thank!

+3


source to share


1 answer


This formula reproduces your example output and will update if more records are added to the 3 tables:

={"CarName","Model","Color";Table1!A2:A,ARRAYFORMULA(IFERROR(VLOOKUP(Table1!B2:B,Table2!A:B,2,0))),ARRAYFORMULA(IFERROR(VLOOKUP(Table1!C2:C,Table3!A:B,2,0)))}



This listing shows a working formula: https://goo.gl/DsYX06

+4


source







All Articles