Google sheets API - Creating sheets properly - google-sheets

i am developing fitness app and i would like to use simple google sheets to fetch data from.
I would like to make something like:
It is possible to structure document somehow and make it work? Or do i need to use something else? Thanks!

If you want to use google sheets as a database, you need to duplicate some of those values so that every row contains all the information you need.
For example, in a "Data" tab:
Week
Training
Area
Exercise
Sets
Reps
1
Training 1
Upper body
Rows
4
5
1
Training 1
Lower body
Deadlift
4
5
1
Training 2
Upper body
Bench
4
5
1
Training 2
Lower body
Squat
4
5
Then you can fetch the data from other tabs.
For example, say you have a tab with the week number in B1:
Select B1, go to Data > data validation
List from range: =Data!$A$2:$A
Press Save and you have a nice drop-down selector for the week numbers
in an empty cell put: =filter(Data!B:F,Data!A:A=B1)
And this is just an example. You can fetch your information with filters, VLookups, query...

Related

How can I count the number of items listed on a different google sheet based on dates in 2 different cells and if another cell is blank?

I have a google doc that tracks information about employee training (Example 1). I have another google doc that needs to summarize the information (Example 2) from multiple different sheets which mirror example 1 but for different teams.
Example 1: this sheet is tracking employees start dates, dates they finish training, and if they have quit. (there are multiple different docs all with the same format that I'm pulling from using importrange).
I need a formula that will count the number of employees currently in training. So count if start date is equal to or after today, end date is equal to or less than today, and the quit column is blank.
If the formula worked the way it should, and I was looking at the summary doc on 11/10/2021, it should report 4 people in the "# in Training" column on the table below (Example 2).
I have tried using an ArrayFormula with CountIfs to accomplish this, but it still pulls 0. Here is the formula I've been playing with:
=ArrayFormula(COUNTIFS('tracker'!$B$2:$B, "<="&TODAY(), 'tracker'!$C$2:$C, ">="&TODAY(), 'tracker'!$D$2:$D,""))
Give a try on below formula-
=COUNTIFS(B2:B8,"<=" & DATE(2021,11,10),C2:C8,">=" & DATE(2021,11,10),D2:D8,"")

How to automatically add a value to sheet 3 if not found in sheet 1

can anyone tell me how to add a value to sheet number 3 if the value is not found in sheet number 1? Should I use vlookup or something? I set up a very basic google form and corresponding google sheet for a spare bus and truck parts business. I would like to add a row to sheet number 3 for every part number that comes into sheet 1 from the google form, that isn't already in sheet number 3. And if possible have the other columns in the new row update information automatically as well.
Sheet number 1 records stock coming in, and sheet number 2 records stock being used, and sheet number 3 is supposed to update inventory records by adding stock coming in and subtracting stock being used. For this, I used the sumif function but there might be a more efficient way to do this as well? =SUMIF('Parts In'!F:F,"*"&A3&"*",'Parts In'!E:E)-SUMIF('Parts Used'!E:E,"*"&A3&"*",'Parts Used'!C:C)
Thanks
Screenshot of sheet number 3

How to call the last number input into a column in google sheets

I have 3 different people with 3 different amounts of money. I want them to input their current bank balance in one row and then when their balance updates I want them to put that value in the row beneath. This way I can make a =SPARKLINE of all the values. I also want the sum of all 3 of our current balances however I cannot figure out how to call the last number input into each specific column. Is there a way to do this?

match values from a range into each row of a table in Google Sheets

I've been working on a multi tiered drop down program, and in filtering one of the tables I stumbled upon a problem I can't find any help on.
Basically, I have 2 sheets. Sheet1!A2:A has a set of values. In this example, A2=110, A3=114, A4=162. However, with each use of the program, there could be any number of values and the values could change.
In the second sheet, Sheet2! there is a table. The first row has the headers that I want to return from my search. Under each header is a series of numbers ranging from 3 to well over 50 values. And the number of columns is also unknown...(it will keep getting larger).
So I want to know which columns have all 3 values from Sheet1!A2:A in them.
Column 3 might have 6 numbers (95,110,114,125,150,162) and column 7 might have (80,110,114,125) so I would want to return the header from Column 3 but not from column 7.
Does any of this make sense? Again in simple terms, I want to query all of the columns in Sheet2 to see which contain all of the values from Sheet1!A2:A
Any help would be so greatly appreciated...
-Daniel
I set up an sheet using your example data:
https://docs.google.com/spreadsheets/d/169VrbWkTlRMzhNPe4G8hQL1MdfqQuTvjb87aRD9hiWo/edit#gid=1923440782
I've restricted the formula in cell D2 to 500 rows for the sake of speed but you can remove the references to make it work across the whole sheet:
=FILTER(Sheet2!1:1,ArrayFormula(TRANSPOSE(mmult(TRANSPOSE(COUNTIF(A2:A500,Sheet2!A2:Z500)),TRANSPOSE(split(rept("1,",COLUMNS(TRANSPOSE(COUNTIF(A2:A500,Sheet2!A2:Z500)))),",")))=count(A2:A500))))

Google Spreadsheets: Use row of nth occurrence of value for other calculations?

I am using a combination of Google Forms and Google Spreadsheets for data entry and interpretation for scouting in a robotics competition (FRC). The user fills out a form for each match with the data from 6 different teams. That data is put into a spreadsheet by the form, and the sheet of data is used by other sheets for interpretation, and it outputs different stats.
One of the sheets is designed to show the progression of the team's stats over the course of their 9-10 matches. I want it to show the values for a certain stat in the same order as the matches that they played (Match 1: 10 points; Match 2: 15 points; etc.). The problem is that there are upwards of 40 teams, so teams don't play back-to-back. I am trying to create a function that searches for the nth occurrence, by row, in the 6 columns that contain team numbers. That function would then use that row to return a value for a stat by that team from that match.
My spreadsheet is here. The sheet of raw data is called "Games", and the sheet containing the progression data is called "Over Time". Within the "Games" sheet, each line is a match, and there is data for each of the 6 teams in each line. Each team gets a line on the "Over Time" sheet, and each stat would take up about 10 columns.
The function would search for the nth time (as specified by the number in row 2) that the team number (as specified in column A) occurs. It would then search that row number for the team number and return the value in the column specified by the function (eg. If the team number occurs in column C, return the value in column E of the same row.). In the sheet "Averages", I used mainly SUMIF and COUNTIF functions to return averages for each stat, but I can't figure out how to use the array functions that would be necessary for the first step of this function. I would prefer to avoid using hidden columns and rows, as that just gets messy, so it would be great if the entire function is in one cell. I would also prefer it to be a function, as opposed to a script.
This solution uses one function per row (not one function for the entire table). In 'Over Time'!B3:
=ArrayFormula(SPLIT(CONCATENATE(REPT('Games'!E$2:BW&CHAR(9);('Games'!C$2:BU=A3)*(MOD(COLUMN('Games'!C$2:BU$2);14)=3)));CHAR(9)))
which can be filled down to B8.
If it is absolutely necessary to have one formula for the entire table, then I'm sure it could be done, but it will be horribly complex. Further, as it is, these "concatenate then split" type formulae (which you need to resort to when the data isn't nicely vertical) are quite inefficient, depending on how big your source data gets. That may not be an issue in your case, but for big source data sets, I would prefer a custom function for performanc ein this case.

Resources