Google Sheets - Add Hours for All Instance of Names - google-sheets

I am rewriting a botched Google Sheet my wife uses for keeping track of kids who volunteer at her library. Each day, the kids select a Group from a drop-down, their name, and enter their time in and out. The main sheet calculates their total hours rounded as well as the total hours of the day and total number of kids who volunteered.
What she wants me to do now is list out all of the kids who are part of the volunteer program and calculate how many hours they volunteered this week. I'll end up getting a total hour count and etc, but for right now I need to figure out how to get all instances of "Kid A" and get the sum of their hours worked.
I was trying to use countifs but I am not sure that's the best function to use. Written as a formula, it'd be something like:
For-Each (name in C9:C74) Sum corresponding value in G9:74
So if Kid A worked 3 times, thus his name is listed 3 times, and his hour counts are 1.25, 2.5, and 0.75, next to his name I'd want it to return 4.5.
Example:

To make it even more simple, you can use SUMIFS...
=SUMIFS(G9:G74, C9:C74, "Kid A")

It's always easier to answer questions when you supply some representative data as part of the question, but 'blindly' based on your description you should be able to do the following to get the required answer:
=query(C9:G74,"select C,sum(G) group by C",0)

Related

Sum in ARRAYFORMULA based on possible cell values of two rows, then subtract another sum based on two different date values in two different columns

I really couldn't put the title into words very well. I will link a template spreadsheet below.
I've been working on a formula for hours now however I keep hitting dead ends. I'm unable to effectively do what I believe should be feasible. I'd give my attempts however I believe it would be of zero help, instead I'll explain my desired outcome.
I have a page with my employees, the E column isn't populated right now as I'd like to create a formula (ARRAYFORMULA so I don't have to paste a formula into each cell) to calculate the output based on a few conditions and values.
Vacation days are calculated as follows. The CEO gets 5, managers get 3 and assistants get 1. Extra vacation days based on points employees receive, 30 points or above is 5, 20 points or above is 3 and 10 or above point is 1.
Calculating the amount of vacation days employees have earned wasn't the hard part for me, it was having the formula subtract days based on how many vacation days have been used in the past 30 days.
We log vacations on the vacation page. The formula on the employees page needs to calculate how many vacation days each employee has used in the past 30 days only and subtract that from the total earned vacation days that employee has earned.
I'd like for the formula to use TODAY() to calculate 30 days in the past however for the sake of this example I'll use the date 06/09/2021 instead for continuity.
Sorry if I haven't explained this well or I'm asking too much in one go, I figured all the context is required.
Example sheet

Calculating average for more than one month of data

I am writing some formulas that will make up a dashboard that allows for a dynamic look-up of change in waiting times for admission into a hospital. In this case, what I want to do is create a lookback period of 1 month, 3 months, 6 months, and 1 year to see how waiting times have changed during this time at a few locations. It's a bit of a complex issue, but the stripped down data and my example code can be found here (fully shared for editing).
I have successfully gotten the correct formulas for finding 1 month worth of change, but how to apprroach more than 1 month's worth of data eludes me and this is especially problamatic because the date formatting is not standard excel/google sheets data format. As this data will be continously fed into the spreadsheet, I don't think I have the option to modify it either so I think the only option is to come up with some pretty funky formulas that treat months as text. Alternatively, I guess I can also try to make a formula that reformats the text into valid google sheets dates and then use that to make calculations but then while I could probably write that formula, I'd still not know how to get multiple months worth of data processed. Can anyone help take a look at the sheet? (feel free to copy/edit the file if necessary).
try like this:
=QUERY({INDEX(SPLIT(Data!A3:A, "T"),,1), Data!B3:C},
"select avg(Col3)
where Col1 >= "&DATEVALUE(EOMONTH(TODAY(), -4)+1)&"
group by Col2
label avg(Col3)''")
spreadsheet demo

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.

Tracking Volunteer Hours Using Google Sheets

I'm trying to find an efficient way to keep track of volunteer hours for each member of a high school volunteer club using Google Sheets. Right now, I have four sheets, one for members of each grade. On the horizontal axis, I list every event and how many hours they volunteer for (or don't volunteer). However, it takes up a lot of columns and I end up having to continually add columns which is a pain, especially when passing the document on for the next "generation" of club officers.
I was thinking of having one sheet for all the members and another for all the events with names and hours of each person who volunteered. The only problem is, I want the main sheet to be able to search through the event sheet for a certain name and then add the hours that correspond to that found name to the total hours on the main sheet.
Is it even possible to search through a different sheet and return a value other than the index? To return a value in a cell next to that of the name?
There are many ways to do this. For a one function solution use QUERY.

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