Google Sheets: aggregate income by week - google-sheets

I have a Google Sheet with monthly data. Dates are on column A and Income is on column B.
I want to do a graphic which shows how much money I've received by week.
How can I do that?
Thanks in advance.

Without your data it is a little hard to tell BUT here is what you would normally do,
If you want to graph by week you will need weekly buckets, to do this use formula weeknum(cell, 1) // 1 is used for sunday to be day 1 in a week (the normal). Then just chart a histogram with weeknum column as your aggregate bucket.
Example -
https://docs.google.com/spreadsheets/d/1MoL-3hTCNspuvblgXM_lbHTZGLTMezZVAwuL_Tur4s0/edit?usp=sharing

Related

=SUMPRODUCT alternative for Google Data Studio?

I have used the SUMPRODUCT formula in Google Sheets to work out the total sum made of 7 products in each month of 2022. Screenshot of the data set and formula used in Google Sheets Formula I am using for the total per month:
However, Data Studio does not seem to accept this formula.
I want to sum the total amount of each product multiplied by the corresponding price for each month it was purchased in. I then want to use this data set in Google Data Studio to show the total amount accumulated for each month.
Google Sheets: https://docs.google.com/spreadsheets/d/1F81cSdnqkoOjEtFWaxjNIdXgeQdwtbzmX2zslT8dXpE/edit?usp=sharing
Google Data Studio Report: https://datastudio.google.com/reporting/9fcbcd71-0c27-4d40-84d3-aef6ed332354
The Google Sheets needs a header also for column A.
Displaying the data in a Table in Data Studio shows:
A sum over the column "January" adds the quantity 1 and 4 and the £340. This gives the wrong 345. A quick solve is to apply a filter on the field "Option" and only consider the "SUM" row.
Another way is to calculate the product by the formula
January*Price
Summing over this product is the standard setting.
For each column (here: 12, January to December) such a formula is needed.

Extracting year with max value for calendar day Google Sheets

I have a sheet with daily readings of lake level and temperature. I want to extract the max level for each day of the year, along with the year that the reading occurred. If it occurred more than once on the same day of the year, I'd like the first occurrence. It's easy enough to get the max for each day, but I haven't been able to also extract the year. I'm sure there are other people much more versed in GSheets than me who can figure this out. I also expect it's not that difficult, but I've yet to be able to find something that works.
Here's the sheet:
https://docs.google.com/spreadsheets/d/1kC3L0oDpnnJlFFuB76mUXiz3vGcfT5_fC3YbkE9Xgsg
UPDATE:
The layout you needed was a little different than what I'd first thought.
This QUERY will generate the maximum and minimums per day for your data.
link to sample sheet
=ARRAYFORMULA(QUERY({1*(TEXT('raw data'!A2:A,"mmm d ")&2020),IF('raw data'!B2:C=0,,'raw data'!B2:C)},"select Col1,MAX(Col2),MIN(Col2),MAX(Col3),MIN(Col3) where Col1 is not null group by Col1 order by Col1 label Col1'Day'"))
Then this formula will use those days and values to do a VLOOKUP back into the Raw Data to show the first year on which that value occurred for that day.
=ARRAYFORMULA(VLOOKUP(N(C4:D)&TEXT(B4:B,"mmm d"),{'raw data'!B:B&TEXT('raw data'!A:A,"mmm d"),YEAR('raw data'!A:A)},2,0))
This spreadsheet will be available forever.

Find Number of Days in Current Month That Fall Between Date Range In Google Sheets

I'm trying to come up with a function that will calculate a monthly budget from within a specified date range. I tried to use SUMIFS but I can't figure out how to isolate a specific month within the range.
Example:
We have a sheet with Google Ad campaigns, with a row for each campaign.
We are running one Google Ad campaign (A) from 2/15/20 to 5/15/20 with a total budget of $3000 from which I calculate a daily budget of $33.33.
We are running a second campaign (B) from 5/15/20 to 8/15/20, also with a budget of $3,000, from which I calculate a daily budget of $32.61.
=IF(NOT(ISBLANK(Start_Date)),Total_Budget/(End_Date-Start_Date),"")
In a separate sheet, I have Budget and Spend fields for each month. For May, I need it to calculate the total budget for 5/1-5/15 of Campaign A, and 5/15-5/31 of Campaign B.
I got this far (J is the Daily_Budget, G is the Start_Date, and H is the End_Date):
=SUMIFS(Google!J2:J30, Google!G2:G30,"<="&DATE(2020,5,1),Google!H2:H30,">="&DATE(2020,5,31))
Then I was at a loss for how to extrapolate the number of days from the range, so that I could then multiply them by the Daily Budget and then add them together.
I thought of going back to the sheet that contains the campaigns and adding columns for each month with a complicated conditional, and then just using SUM(), but I feel like there has to be a more elegant solution.
UPDATE
Per request, here is a link to the spreadsheet with the desired results manually entered: Click here. May & June show the campaign partial month overlaps. The result I'm ultimately going for is =(15*Google!J2)+(16*Google!J3).
UPDATE 2 (24Jun20)
Per request, I have shared the spreadsheet so that people can make a copy and experiment with formulas: Click here..
Any ideas?
Thanks,
Ty
I would use the function DATEDIF() (documentation here). You can set the first parameter as the first day of the month you are trying to calculate the number of days within it, and the second as the first day from another month. Example:
DATEDIF(DATE(2020, 1, 1), DATE(2020, 2, 1), "D")
You could probably make a custom function with this as well to input only the number of each month (and year, in case of leap years on February), but I don't have much experience with that unfortunately.

Add numbers in Column B based and on Day of the Week in Column A and display highest/lowest resulting Day

I have a sheet that lists every day of the year and is updated on a daily basis. Next to each day is a percentage. I would like to display the day of the week that has the highest (and lowest) percentage when adding all relative days throughout the year. (i.e.: all Thursdays)
I am using this formula, which only partially works. It displays the day of the week, but seems to only reference the latest occurrence instead of all in Column A.
B2:
=iferror(INDEX($A4:$A,MATCH(MAX(B4:B),B4:B,0)),"")
B3:
=iferror(INDEX($A4:$A,MATCH(MIN(B4:B),B4:B,0)),"")
Link to a sample book: https://docs.google.com/spreadsheets/d/1_LP5MmmgW3i0zM6ziud9YrWfH5SvuHFbZH3OmRj9W6E/edit#gid=0
I hope this is enough information to understand what I am hoping to accomplish.. Is this possible in Google Sheets?
If I can get this to work my second goal would be to show the highest/lowest for the current month (or a specific month) in addition to the whole year.
Thanks!
Take a look at the shared spreadsheet and see if it does what you want.
https://docs.google.com/spreadsheets/d/1LL4Mgn_IWa-8W6Q0TythdMhBieVFt8ZiKI_UeO9ciTI/edit?usp=sharing
Added col L,O,R,and U for numeric day of week, current month,
current year, and month number. You can hide these columns.
I added some data for testing.

How to calculate average calls "timestamps" per day on Google Sheets

I need help calculating the average number of calls I receive per day on Google Sheets. I can use your help.
Specifically, I want to calculate average calls per day [count: timestamps] for weekdays and weekends, respectively.
Here is the link to the Google Sheet: https://docs.google.com/spreadsheets/d/1UnHxSuQeFcKWIYrZxHrKQFJQ0TNekNAGrlvY-CyfYdU/edit?usp=sharing
I have found several links that come close to the solution but nothing that solves it, e.g. http://yogi--anand-consulting.blogspot.com/2013/05/yogifrom-timestamp-column-compute.html
Thank you in advance!
The question has not been asked very well, it important to show your attempts and specifically what you're look for. But none the less:
Create a separate column in call sheet E:E with the formula =weekday(a1) this will convert your date into a day of week number (1 through 7). From that, use sum if =SUMIF(F:F,"<=5") for your weekday, and=SUMIF(F:F,">=6")` for weekwend

Resources