I'm trying to create two lines on the same graph, with one being 'Line A' based on Data labeled 'A' and 'Line B' based on B.

The X-axis would be the date and would expand over time as more entries were added. The weight would be the Y-axis.

I can't seem to convince Google sheets to separate out the data based on the 'Name' column into two lines. Any help would be appreciated.

An example of data I'm trying to graph with two lines

1 Answer 1

  • your data should be in this format:


  • if this is not the option you can transform it with this formula:

=QUERY(A1:C, "select B,sum(C) where A is not null group by B,C pivot A", 1)


  • Is there a way to do the same where the data for A and B would be on different sets of dates? My data is structured in the same way as your first image but A and B occur on different dates, this results in dots rather than lines.
    – Chris A
    Aug 3 at 13:37
  • 1
    @ChrisA i.stack.imgur.com/1Dvd0.png
    – user0
    Aug 3 at 14:21
  • 1
    Great work, thanks!
    – Chris A
    Aug 3 at 17:35

Your Answer

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

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