I'm trying to create a sheet where it will automatically fill out columns based on their role.
I have here Sheet 1, the dump where players' name will be placed and a dropdown of their roles.
On another sheet (Sheet 2), I have 2 columns, of which I need to sort if they are a player (Rank 1 to Rank 5) or a setter.
I am trying to return the values of 'Name' to its respective column on Sheet 2. I tried using arrayformula with ifs but it just returns false. Is there a way for me to do this?
Here's a sample file: https://docs.google.com/spreadsheets/d/1Qkk9a3r3xJbRgqJfKQKGN8vSrAUz259D5ICuf4bAAaU/edit#gid=1063674487
Filter by Rank or Setter:
=FILTER(Sheet1!A2:A10, Sheet1!B2:B10="Setter")
For rank, try <>Setter
Related
I need to update a cell with a defined value automatically by comparing and referencing this data from another Google sheet.
In Sheet1 Column_C is to be updated by comparing Column_A in Sheet1 to Column_A in Sheet2.
If it is a match, and Column_B's value from Sheet2 is 1, then the result should be "issued", otherwise it should be "in-stock".
Sharing google sheet link :
https://docs.google.com/spreadsheets/d/1h_D5u16ye1CA6C7dideJVZoV8cBvZB8M3RRxXBANsf4/edit?usp=sharing
How can I accomplish this using Google Sheets?
Try this in cell C1 (delete all other values below):
=arrayformula({"Status";if(A2:A<>"",substitute(substitute(iferror(vlookup(A2:A,filter(sheet2!A:B,countifs(sheet2!A:A,sheet2!A:A,row(sheet2!A:A),">="&row(sheet2!A:A))=1),2,0),),1,"Issued"),0,"In-Stock"),)})
To handle items in sheet1 that are not in sheet2, you can add a value in the iferror function (the first "In-Stock" below):
=arrayformula({if(A2:A<>"",substitute(substitute(iferror(vlookup(A2:A,filter(sheet2!A:B,countifs(sheet2!A:A,sheet2!A:A,row(sheet2!A:A),">="&row(sheet2!A:A))=1),2,0),"In-Stock"),1,"Issued"),0,"In-Stock"),)})
This is responsible for getting the dataset from sheet2:
filter(sheet2!A:B,countifs(sheet2!A:A,sheet2!A:A,row(sheet2!A:A),">="&row(sheet2!A:A))=1)
This part gets the instance number of each duplicate value in sheet2!A:A:
countifs(sheet2!A:A,sheet2!A:A,row(sheet2!A:A),">="&row(sheet2!A:A))
Where there are duplicate values, ">=" gets the one furthest down the sheet. Changing it to "<=" will get the first instance at the top of the sheet.
Within filter, countifs(sheet2!A:A,sheet2!A:A,row(sheet2!A:A),">="&row(sheet2!A:A))=1) filters the column to show just 1 instance of each value in sheet2!A:A.
Looking at your example sheet, you have these values in row 6, 7, 8, so the first instance (ascending or descending) will be 0:
1230E 0
1230E 1
1230E 0
If you're looking for a different logic, like 1 trumps 0, then you'll need to apply a sort on the data before performing the vlookup. Something like:
=arrayformula({if(A2:A<>"",substitute(substitute(iferror(vlookup(A2:A,unique(sort(sheet2!A2:B,1,1,2,0)),2,0),"In-Stock"),1,"Issued"),0,"In-Stock"),)})
I have two sheets, one with product names (sorted alphabetically) in column A, stock levels in column B.
Sheet 1
The other 2nd sheet with the same products in column A and stock levels in column B but populated by "importrange" but with columns C and D manually populated with customer names.
Sheet 2
What I'd like to do is, if a new product is introduced in the 1st sheet and it is positioned alphabetically in (let's say) row 3, then have a new row appear in the 2nd sheet.
Sheet 2 ideally
Currently, if a new product is introduced, the 2nd sheet will show the product and stock level, but the manually entered data in columns C and D will then be out of sync by one row.
Sheet 2 currently
Is there a way of automatically inserting a full row when the new product is imported to the 2nd sheet if I'm using "importrange"? If there is, can someone please help me here with the formula or code.
Basically what the OP is asking is how to keep the spatial/positional relation between two data sets. One alternative is to adopt the use of "keys" and "foreign keys".
Let says that a row represents a record.
A key is an unique value that used to identify a record.
A foreign key is a value added to a record to relate it with a record from another data set
Applying the above to the question case:
On Sheet 1 add a new column to hold the key for each row. When a new record is added the key of the other records should not be changed and a new key should be assigned to the new record.
Create a table of for the values of Sheet 2, columns C and D, and add to each record a key.
NOTE: This is the table were you should do the manual input.
Create a relation table having two columns one for the keys of the records on Sheet 1 and another for the records of Sheet 2, Columns C and D.
NOTE: I will not discuss here the arity of a relation concept as it will make the answer too long.
On Sheet 2, use IMPORTRANGE to get the values from Sheet 1, including the keys for each record.
Add a lookup formula (VLOOKUP / INDEX-MATCH) to get the related records from the table created on step 2 by using the relation table created on step 3.
Related
Synchronize independent spreadsheet rows, filled by IMPORTRANGE()
Associating row data with importrange data in a new workbook on Google Sheets
How to look up a value in multiple columns and then extract the corresponding relative value.
example: there are (100rows x 3columns) x 5 sets next to next with name, phone, email. so search for phone(unique), and return the corresponding name.
Vlookup performs only one column
match takes on one row or column
Sample sheet attached
Need values in the 2nd sheet
To perform multiple criteria in a VLOOKUP, the easiest way would be to create a helper column. For example, you can concatenate all the parameters you want to include as criteria with a character like the underscore _, and perform a VLOOKUP with the key also concatenated.
You can also do it without helper columns if you combine INDEX and MATCH. To do this, it's set up the same way as a single-criteria INDEX/MATCH, except the MATCH is set up to search for 1 as a key, with the lookup array being (condition_range1=condition1)*(condition_range2=condition2)*....
I've set up an example showing both techniques here: https://docs.google.com/spreadsheets/d/12viS6lkaokXs-G6Wl4UU7H6-wmNX_79XYm-JCPPSBdU
paste in Sheet2!C3 cell:
=ARRAYFORMULA(IFERROR(VLOOKUP(A3:A,
{Sheet1!B:H; Sheet1!I:O; Sheet1!P:V; Sheet1!W:AC; Sheet1!AD:AJ; Sheet1!AK:AQ},
{3, 4, 5, 7}, 0)))
I've created a form to collect data from user A in a sheet and reformat it for user B in the other sheet.
I have to sort the data for user B. I'm using vlookup to sort the column of values from the form to a new sheet (sort based on the order of the 'value description column'). It's working.
My problem is that when a new column is added to the first sheet (the form) the column range is modified and the index parameter in vlookup is not good anymore. So I lost everything on my second sheet.
How can I do to have a solid link with the column in the first sheet even if it's position change?
you can make use of INDIRECT with COUNTA and SUBSTITUTE. something like:
=INDIRECT("Sheet1!A1:"&SUBSTITUTE(ADDRESS(1, COUNTA(Sheet1!1:1), 4), 1, "")
this will count non-empty cells in row 1 of Sheet1 and converts that number to later which is used in constructing the range put together by indirect formula and all of it can be placed in vlookup as same as you would place any ther regular range.
I am using google sheets to do the following.
Sheet 1 : 1 column for each person who needs access to the file. Each column's cell has a dropdown menu so people can select what items they have.
Sheet 2 : A list of every item in column A, columns B through G are the names of the people.
What I am trying to do is to have on sheet 2, the words "YES" or "NO" appear under each person's name if they have selected the item whatever the order.
So if Person 1 picks in the dropdown of sheet 1 that they have Item 1, Item 3, Item 2 in this order, I want sheet 2 to show the "YES" or "NO" mention. I don't want the order of the items in the list to be an issue.
So far, I have tried these 2 methods :
=IF('Sheet1'!A2:A25=A2;"YES";"NO")
=IF(RegExMatch('Sheet1'!A2:A25;A2);"YES";"NO")
These do not work as the items must be selected in the same order as they appear in the second sheet. Is there another function that can validate a list in any order and apply the appropriate value?
Thanks ahead!
Jason
Edit : https://docs.google.com/spreadsheets/d/1cNn7G9x9o56d_9qM18s3AULkhpfOV5Y-b55vycCUyLY/edit?usp=sharing
Sheet2!B2:
=ARRAYFORMULA(IF(ISERROR(MATCH($A$2:$A$100;Sheet1!A2:A25;0));false;true))
MATCH Sheet1A column against Sheet2A column
IF MATCH returns error, FALSE, else TRUE.