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.
Related
I am trying to build a sleep tracker in Google Sheets (link). The idea is to select a year and a month from a drop-down list in cells A1 and A2, which would then populate columns based on the number of days in that month. I have tried different formulas that I found on stack overflow and elsewhere, but could not get them to work.
In short:
I am looking for a formula that will populate the columns with days of that month and a name of the day in a row bellow.
Looking for a way to summarize the time of sleep at the end of the each day, based on a ticked checkbox.
I am not sure how the year and month selectors should be formatted (as plain number or a date).
Is there a way to automatically insert check-boxes to the days of the month?
This is the formula that I have tried to adjust:
=INDEX({TEXT(SEQUENCE(1; DAY(EOMONTH(A2&"/"&A1;0)); A2&"/"&A1; 1); {"d"; "ddd"}); {"Total"; ""}})
But it returns with "Error In ARRAY_LITERAL, an Array Literal was missing values for one or more rows."
Please note that ";" is used as an argument separator instead of "," (regional settings).
Thank you in advance!
I think that with a very small adaptation and date formatting you'll be able to easily do it. First with your selector in A2, you could set it as actual dates, but format them as mmmm:
Then, repeat the sequence in both rows starting in C2 and C3:
=SEQUENCE(1,DAY(EOMONTH(A2,0)),A2)
But formatting row 3 as ddd:
PS: yes, you can do row 3 with TEXT and INDEX. Choose your preferred one:
=INDEX(TEXT(SEQUENCE(1,DAY(EOMONTH(A2,0)),A2),"dddd"))
UPDATE with TEXT VALUES
Return to your previous A2 dropdown and try this, using MATCH to find the number of the month, and DATE to locate the correct beginning of the month in that year:
For row 2:
=SEQUENCE(1,DAY(EOMONTH(DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1),0)),
DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1))
For row 3:
=INDEX(TEXT(SEQUENCE(1,DAY(EOMONTH(DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1),0)),
DATE(A1,MATCH(A2,{"January","February","March","April","May","June","July","September","October","November","December"},0),1)),"dddd")
)
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.
I am looking to create a spreadsheet that my staff fill out, it then gives me a master sheet with all the data, then I import dynamically to my financial spreadsheet telling me the average cost of my client over the last 30 days.
I am looking to create an AVERAGE formula of the last 30 days when Date = Today (Monday) (I want the weekday Monday as that's when staff hand in invoices)
Hope this makes sense, it's really tough!
Here's a video of me explaining my desired outcome
https://www.loom.com/share/3a9cb75052b246d1af2ba2f9ce9180a7
I've followed several guides & can't figure it out.
=ArrayFormula(iferror(query(average(if(today() - weekday(today(),3)-30)))))
I expected $90 average and I just get blank
You could use this formula:
=AVERAGE(VLOOKUP(TODAY()-WEEKDAY(TODAY(),2)+1,A:H,2,FALSE),VLOOKUP(TODAY()-WEEKDAY(TODAY(),2)-6,A:H,2,FALSE),VLOOKUP(TODAY()-WEEKDAY(TODAY(),2)-13,A:H,2,FALSE),VLOOKUP(TODAY()-WEEKDAY(TODAY(),2)-20,A:H,2,FALSE))
To break it down in to its component parts, the AVERAGE is taken from VLOOKUP results:
VLOOKUP(TODAY()-WEEKDAY(TODAY(),2)+1,A:H,2,FALSE)
The VLOOKUP is looking for the last Monday from the current date:
TODAY()-WEEKDAY(TODAY(),2)+1
Then
TODAY()-WEEKDAY(TODAY(),2)-6
and so on...
When using on your sheet, you will have to specify the column you want to reference in your look up, for colunm B (brand1) use: A:H,2,FALSE), for colunm C (brand2) use: A:H,3,FALSE), for colunm d (brand3) use: A:H,4,FALSE) and so on...
=INDEX(QUERY({INDIRECT("A2:D"&ROW()-1)},
"select avg(Col2),avg(Col3),avg(Col4)
where Col1 <= date '"&TEXT(TODAY(), "yyyy-MM-dd")&"'
and Col1 >= date '"&TEXT(TODAY()-30, "yyyy-MM-dd")&"'"), 2, )
I'm trying to have a function in Google Sheets that adds up values from a range if the were entered on a Monday. This is what I have right now, but it adds up to 0 all the time:
=sumif(B6:B20, WEEKDAY(2),C7)
Can someone tell me how to determine what day of the week a number cell was added on, and then add up all the numbers added on that day so I can put the sum in a different cell? (For example, the numbers in the range were added on various days of the week, and I want to add up all the numbers that were added on Monday)
Assuming column B is the column to sum and column C has the dates try:
=sumproduct(weekday(C2:C) = 2,B2:B)
I'm sure this is doable and I'm just not finding the solution in the documentation, so big thanks in advance for your help. I want to calculate sales growth month over month.
For example, I'm posting this question on 10/22/2014. Calculating sales thus far for this month is easy, but I also need to know what sales were for the first 22 days of LAST month.
I already have a column containing the values for each day this month, and another column containing the values for each day last month. All I need to do is a way to sum the values for the first 22 days of last month.
Column AH = A list of the dates for last month: 9/1/2014, 9/2/2014...
Column AI = A helper column containing only the DAY of the month of the value in Column AH: 1,2,3,4...
$AJ35 = The day of today's date =DAY(TODAY())
Column AN = The numbers I want to (conditionally) sum
Why won't this formula work?
=SUMIF(AI1:AI34,"<=$AJ35",AN1:AN34)
It calculates a sum of 0.
If I take out the comparison ("<=$AJ35") and manually insert a number, it works fine:
=SUMIF(AI1:AI34,"<=22",AN1:AN34) returns a value of 362, as expected.
That is because you have put a cell reference inside a string (surrounded by double quotes)
which means that google is trying to compare against a literal string "$AJ35"
you have to concatenate the cell reference and the operator like so:
=SUMIF(AI1:AI34,"<=" & $AJ35,AN1:AN34)