How to set a range of cells equal to a separate cell? - google-sheets

I'm working on Google Sheets with baseball statistics. I have one sheet that has the team names going across row 1 & underneath each team name; I have the players names.
I also have a second spreadsheet which has players names and all their statistics for a certain time frame. The issue is that on the second spreadsheet it only has the players names and doesn't tell me what team they play for?
Is there a formula that will search the first sheet for the players name and display the team name in a separate column next to the players name on the second sheet?

Related

Imported data into Google Sheets, match and change one Column of Data

I have a google sheet that users input data on. These sheet has complete town names. Eventually the data they input gets uploaded into a program which has the town names abbreviated. Im looking for a way to automate basically doing find and replace.
Sheet1- Users input
Town
Data
Washington Town Center
123345
Washington Town Center
988765
Fairland Heights
12345
Sheet2 - Reference to the correct names for program.
User
Program
Washington Town Center
Washington Twn Ctr
Fairland Heights
Fair Heights
I basically need to replace the Town names in Sheet1 with the names the Program uses and then all data with that row. A new sheet worth of data is sent every week, so Im looking for the most efficient way to change those names.
I have tried using QUERY and FILTER but cannot seem to find the best way to go about this.QUERY would find all the matches and add as multiple rows as the user sheets can have multiple entries for same town
=QUERY('Sheet1'!A:G,"select * where A like '%"&A2&"%'",0)
you need VLOOKUP:
={INDEX(IFNA(VLOOKUP(Sheet1!A:A, Sheet2!A:B, 2, ))), Sheet1!B:G}

How to show employees who were absent (did not clock in) in Google Sheets with Google Form data?

I made a Google Form for employees to use to clock in and out each day. The data is going to a Google Sheet, which is turned into a pivot table and all is well except for how to view which employees did not clock in on a specific day. Ideally, I want a list of absent employees per day/employees who did not clock in/out on a certain day.
The Google Form has employees select their name from a drop down menu and select clock in or clock out. The data goes to a Google Sheet, which I have made a data processed tab from, to make a pivot table from. The list of absent employees does not need to be within pivot table, it can be a seperate tab. If it is possible to have absent employees listed somehow in the pivot table, that's great. Not a big deal if not.
Right now, I am manually going in and selecting employees who clocked in/out on a particular date, adding that to its own column, and comparing that column with the master employee list. Is there an automated way to do this? I am familiar with comparing two columns, but can't figure out how to sort employees based on the date they clocked in/out into one column to then compare it to another one (unless I manually create column at end of work day). Thank you!!
https://drive.google.com/file/d/1v5ssyIaW0fUdIBTKTr6FNZIzV1WNilqN/view?usp=sharing This is the raw data from Google From
https://drive.google.com/file/d/1axWe_nPSTvIPM2RvIz7AQZE_NSJmIEdQ/view?usp=sharing This is processed data which fills pivot table
https://drive.google.com/file/d/13rBxzJ5RtnYc-vo3RzocMrSwtMy9kbaB/view?usp=sharing This is pivot table

How to use CountIf in Google Sheets that only counts cells if there is content in another cell?

I need some help with a CountIf type formula in Google Sheets.
I have a large spreadsheet of a consolidated NHL schedule where I am going to enter stats that I care about. In a separate spreadsheet I am going to have averages for the stats I care about.
I want to have a formula that uses the Column A of Sheet2 to count the games in Sheet1 that have content in the other cells of Sheet1 (so, games that have been played).
If this works then Column B of Sheet2 will have the correct # of games played which is all the cells that have content/stats next to the teams name in Sheet1 so that I dont have to manually update that part and then the count of games played can go straight to the average formula.
The pictures are manually entered but just showing that since the Blackhawks have content next to their name in Sheet1, I would want Sheet2 Column B to read 1 based on a formula.
Thanks!!!
Sheet1
Sheet2
I would just do a COUNTA on a column (so that counts the rows in a specific column that are not blank), on a filtered table that match the team names:
So:
=COUNTA(FILTER(Sheet1!D:D,Sheet1!B:B=A3))

How to remove a row of data from a ImportHTML

I have a project for school, to make a Fantasy League in Google Sheets. I am trying to grab the game-by-game states for the players I have on my team. I only have one problem:
how do I remove the REGULAR SEASON STATS without affecting next week's results?
Example: Player.
Wrap your ImportHTML in a QUERY that selects where Col1 <> 'REGULAR SEASON STATS'.

Count total games played in a league standings template

I'm working in Google sheets
I've created a league standings template here:
https://docs.google.com/spreadsheets/d/1aTJsKkORRka1f4Z3Ibb87XGq-6Sv3qFaCYSsW8D3kHM/edit?usp=sharing
The last thing I'm really hung up on is calculating the amount of games that each team has played. Basically I need the G column to use the formula for each cell to see if the corresponding team has completed their games from the 'League Scores' table.
I currently have this formula:
=countif(filter($C4:$C, $B4:$B=$J$4), "<>") + countif(filter($D4:$D, $E4:$E=$J$4), "<>")
Each team could play on either side of the league score sheet throughout the season. So my logic is that the first 'countif' function would search through the first Team name column and Scores column to see if the team name was mentioned. If it was, it would then check to see if there was any score listed at all. If true, then it would add one to the Games played counter. The second half of the formula is to check the right side of the leagues team and score columns repeating the same process.
You can see however, that the 'GP' (games played) column lists an inaccurate amount of games played per team and even saying that teams which haven't yet played a game are at 2 games played.
What am I missing?
The extra count is coming from the case when the filter returns no rows and you get #N/A. The Countif still counts it as 1.
Suggest using Countifs instead, something like
=countifs(B:B,J4,C:C,"<>") + countifs(E:E,J4,D:D,"<>")

Resources