You can bring you data in `A:C` to the format ``` X 1 20 Y1 2 20 Y1 3 20 Y1 5 25 Y1 10 30 Y1 1 25 Y2 3 42 Y2 6 50 Y2 8 50 Y2 10 50 Y2 ``` and then use ``` =QUERY(A:C,"select A, sum(B) where A is not null group by A pivot C") ``` to generate ``` X Y1 Y2 1 20 25 2 20 3 20 42 5 25 6 50 8 50 10 30 50 ``` ready to be plotted.