0

I have a table with X-Y values for two types of measurements, I want to draw two graph lines on a chart for each of the type (without modification of data in the sheet)

x-values y-values type
0 5 A
0 6 B
1 3 A
1 2 B

alternative would be to use 2columns table, but I would have to transform data from source which i would like to avoid

x-values y-Avalues y-Bvalues
0 5 6
1 3 2

desired graph

1
  • Welcome to Web Applications Stack Exchange. I do not think there is a way to use a filter or formula in a chart data range definition, so you will probably have to recast the data in order to plot it the way you want. Dec 23, 2021 at 11:29

1 Answer 1

2

Choose Insert > Sheet and put this formula in cell A1 of the new sheet to pivot the data the way need:

=query( 
  Sheet1!A1:C, 
  "select A, max(B) 
   where A is not null 
   group by A 
   pivot C", 
  1 
)

Then insert a chart based on the data in the new sheet.

1
  • Thanks, cool trick!
    – glaz666
    Dec 23, 2021 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.