Home > database >  How to prevent future incomplete data from skewing a chart and it's trendline on Google Sheets
How to prevent future incomplete data from skewing a chart and it's trendline on Google Sheets

Time:08-21

I prepared enter image description here


update:

try:

=IFERROR(ARRAYFORMULA(QUERY({
 QUERY({INDIRECT("Data!A2:D"), WEEKNUM(INDIRECT("Data!A2:A"))}, 
 "select Col5,sum(Col2),sum(Col3),sum(Col4),count(Col5) 
  where Col1 is not null group by Col5", ), IFERROR(
 QUERY({INDIRECT("Data!A2:D"), WEEKNUM(INDIRECT("Data!A2:A"))}, 
 "select Col5,sum(Col2),sum(Col3),sum(Col4),count(Col5) 
  where Col1 is not null and Col1 < date '"&TEXT(TODAY(), "e-m-d")&"' group by Col5")*SEQUENCE(ROWS(
 QUERY({INDIRECT("Data!A2:D"), WEEKNUM(INDIRECT("Data!A2:A"))}, 
 "select sum(Col2) where Col1 is not null group by Col5", )), 1, 1, 0))}, "offset 1", )), "e")

enter image description here

demo sheet

  • Related