1

I want to create a chart in Google Sheets with cumulative Profit (H) column but without creating the second column (I). Are there any solutions?

enter image description here

1
  • A strange desire is a dubious decision. Feb 25, 2019 at 13:50

1 Answer 1

2

=SPARKLINE(ARRAYFORMULA(IF(H2:H; 
 MMULT(TRANSPOSE((ROW(H2:H)<=TRANSPOSE(ROW(H2:H)))*H2:H); 
 SIGN(H2:H)^2); IFERROR(1/0))); 
 {"charttype" \ "line"; 
  "color" \ "red"; 
  "linewidth" \ 3})

=SPARKLINE(ARRAYFORMULA(IF(H2:H; 
 MMULT(TRANSPOSE((ROW(H2:H)<=TRANSPOSE(ROW(H2:H)))*H2:H); 
 SIGN(H2:H)^2); IFERROR(1/0))); 
 {"charttype" \ "column"; 
  "color" \ "red"})

9
  • This solution maybe works but it not a chart object. For example I can't see chart's legend or publish this chart. Feb 18, 2019 at 6:40
  • 1
    @VadimSelyakov this is all you can get without column I
    – user0
    Feb 18, 2019 at 11:39
  • This is exactly what I'm looking for, except I need to filter the range by a specific date. I've been using FILTER(Log!$N$2:$N, Log!$B$2:$B=A3), where A3 is the cell containing a date to filter by. I can't find the correct way to alter your solution to include a filtered range. Could you please enlighten me!? Thanks Sep 5, 2020 at 11:30
  • @MustImpress can you share a copy of your sheet?
    – user0
    Sep 5, 2020 at 21:00
  • @user0 Thanks for the quick reply! Here's a copy: docs.google.com/spreadsheets/d/… The chart is on the "Days" tab. "Log" is just input data. I've managed to reduce the rows using a filter but I can't see how to apply a filter to your clever logic. It's beyond me :) Sep 6, 2020 at 9:50

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.