0
votes

I have two sheets in a google sheets document. They look something like this:

| Date       | Value |
| 2015-01-01 | 100   |
| 2015-02-04 | 200   |
| Date       | Value |
| 2015-01-01 | 100   |
| 2015-05-04 | 150   |

The dates and values are NOT regular. I'd like to plot both tables into a single line graph with date along the x axis, and two lines representing the values in each of the tables respectively. I don't want to have to merge the two tables, unless I can merge them automatically with a pivot table or something.

When I insert a chart, I have to choose the column which represents the x axis. In my case, I need the date column from both tables, so effectively two columns to represent my x axis.

A use case for this is simply showing the bank balances for two separate accounts in a line graph.

Thanks.

1

1 Answers

6
votes

You can create another table on a new sheet that will merge the data columns from each of these tables, and then have two VlookUp columns, one for each table, and create a graph based on these three columns. two merge Data columns from two different sheets use this

=FILTER({Sheet1!A:A;Sheet2!A2:A},{Sheet1!A:A;Sheet2!A2:A}<>"")

Your second column will will have the following VlookUp formula

=IFERROR(VLOOKUP(A1,Sheet1!A:B,2,false))

Third Column

=IFERROR(VLOOKUP(A1,Sheet2!A2:B,2,false))

Then just make a graph based on this table that should look something like this

| Date       | Value |Value |
| 2015-01-01 | 100   |      |
| 2015-02-04 | 200   |      |
| 2015-01-01 |       | 100  |
| 2015-05-04 |       | 150  |