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?
1 Answer
=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"})
-
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
-
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
-
-
@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