Time series chart till current week - google-sheets

I have this google sheet which contains 3 fields.
Week number
Weekly website page views for this year. It contains data until current week (19) this year.
Week website pageviews for last year. It contains data for all the 52 weeks during previous year.
In data studio, I am using a time series chart to visualize this data.
Following are a couple of issues that I want to fix
The chart is displaying data for all 52 weeks since last year's page views field contains data for 52 weeks. I only want the chart to display till the current week. That is, the chart x-axis should be until week 19 only.
In case the chart is displayed in its current state will all 52 weeks, the blank cells for weeks in the current year are displayed as 0. (see the blue line coming down to zero and extending till week 52). How to avoid this and just end the line on week 19.
Please advise how to go about this.
Update:
Based on the answer
=query(Data!A1:C, "where B is not null", 1)
I have stripped the data for the remaining weeks but the chart is still showing week till 52, though the sheet only contains data till week 19. The week field only contains week numbers from 1 to 19.

To create a helper table that only includes rows where column B contains data, use Insert > New sheet and this formula in cell A1 of the new sheet:
=query(Data!A1:C, "where B is not null", 1)
Then use the helper table as your data source.

Related

How to highlight a column in Google Sheets if this column contains dates Mon and Sun where Mon>today and today<Sun

I've created a custom schedule in my Google Spreadsheet broken down onto weeks with Mondays in row 1 and Sundays in row 2.
So far I can highlight only particular day in rows 1 or 2 that equals to today (simple condition 'Date is in the past week').
I need to highlight entire column if Monday>today and today<Sunday.
How to do it via conditional formatting formulas?
Thanks.

Find last row value in 2nd column from the right

I have a spreadsheet (well multiple spreadsheets) that have sales values for each month in each column - so these keep getting added to each month.
Product
03-2022
04-2022
Total
Product 1
33
46
79
Product 2
20
32
52
I am looking for a way in Google Sheets to retrieve the last value in the 2nd from last column, so it would always be the most recent month and wouldn't need to be changed even as new columns are added before the Total column.
The spreadsheets I'm using have a lot more rows, and I can't reference a specific column as the most recent month is obviously constantly changing.
Any help would be really appreciated as I'm banging my head against a wall!!
Paste this formula in a new tab assuming the source tab is named Sheet1
=INDEX(Sheet1!A1:1000,,COUNTA(Sheet1!1:1)-1)
In this case
More columns

Google sheets lookup and sum

I have a production schedule where cells are filled with text:
Day 1, Day 2 etc.
And I'd like these cells to be associated with values elsewhere in the same sheet.
For example. Day 1 would be 4 (which corresponds to 4 hours).
Then I have to sum these cells/values (Day 1 = 4 + Day 2 = 6) to get a total for each row.
I can't seem to find a way to do all this using one formula. Is it even possible?
Feel free to check out the sheet.
=SUMPRODUCT(IFERROR(VLOOKUP(B2:L2,Formulas!A:B,2,0)))

Min Custom formula for monthly expenses spreadsheet

I have a sheet with this table as an example:
What I want to do is a formula that displays the lowest value from today until the last day.
Example: If today is the first day, the lowest value (column "Current") until the end of the table is $50 (day 2).
But if today is day 3, for example, I want the cell to display the lowest value from day 3 until the last day, in this case, it would show value $450 at day 4, ignoring all the previous values before day 3.
Is this possible?
D4:
=MIN(C4:$C$10)
Drag fill down
I could find in a forum how to use matrix to calculate:
{=MIN(IF(days>=DAY(TODAY());values))}
Where days and values are named ranges.

A formula to average data from the last month

I am trying to make a formula that will give an average of the numbers from column 'D' of 'TEST SHEET' into another Tab. That is easy enough, but I only want to use the data from the last 30 days.
I've been trying to create a formula, but I am new to these things and have only received error messages.
TEST SHEET
Try the following formula:
=AVERAGEIF('TEST SHEET'!A3:A,">"&today()-30,'TEST SHEET'!D3:D)
To get average for the days between last 60 and last 30 days ago, try the following formula:
=AVERAGEIFS('TEST SHEET'!D3:D,'TEST SHEET'!A3:A,">"&today()-60,'TEST SHEET'!A3:A,"<"&today()-30)

Resources