Google Sheets associate unique - google-sheets

I have 1000+ items (Game Names) in Sheet1 with some duplicates. In Sheet2 i use "unique" function to remove the duplicates and get them sorted alphabetically. Next to each record (2nd column) i assign Publisher values.
The problem is that if I add a new record in Sheet1, the record will be added in Sheet2 but the values from 2nd column are staying in place without matching or following the original content. I believe the issue appears because sorting is applied
Sheet1
Sheet2
So if i add a new entry "Abacus" in Sheet1, it will sort alphabetically again in sheet2 but publishers value will remain in place they will not follow the sorting

Related

Trying to auto-generate SKUs in Google Sheets using prefix and sequence number but it breaks when sheet is sorted

I want to automatically generate unique, incremented ids (SKUs) for products in my inventory using Google Sheets. These SKUs should be immutable and not change when the sheet is sorted. This screenshot shows my flawed attempt to do this:
The formula I have for column A is:
=if($B2<>"",$B2 & TEXT(COUNTIF($B$2:$B2,$B2),"-0000"),"")
That formula appears to give the desired result. However, if I sort by the values in Column C, SKUs become associated with different Item Names, which is a problem. How can I modify the spreadsheet to get immutable, auto-generated SKUs?
Update:
I would like to be able to add additional rows/SKUs to the sheet over
time
Here is a link to the sample spreadsheet
I've added a sheet ("InventoryMaster(Unsorted") to your spreadsheet.
This sheet would be used to add your prefixes and items only. Once added, you would never sort, insert rows, delete rows or items, etc. Just keep adding the next prefix and item into the next open row, in Col B and Col C. Col A has a formula that will create the static SKUs from that unchanging and ordered information. (I've hidden that formula-containing Col A, so that you only have to enter the manual data and don't have to worry about accidentally overwriting the formula or its results. It's still there at all times, serving its purpose in the background.)
Then, other sheets (see my added "Erik Help" sheet) can reference that "immutable" list, giving you the ability to sort without losing SKU connection.
Here is the A1 formula from the 'InventoryMaster(Unsorted)' sheet:
=ArrayFormula({"SKU";IF(B2:B="",,B2:B&TEXT(COUNTIFS(B2:B,B2:B,ROW(B2:B),"<="&ROW(B2:B)),"-0000"))})
And here is the SKU-assigning formula from A1 of the "Erik Help" sheet:
=ArrayFormula({"SKU";IF(B2:B="",,VLOOKUP(B2:B&C2:C,{'InventoryMaster(Unsorted)'!B2:B&'InventoryMaster(Unsorted)'!C2:C,'InventoryMaster(Unsorted)'!A2:A},2,FALSE))})

How to get row List elements compare by two rows Google Sheets

I have spreadsheet https://docs.google.com/spreadsheets/d/1qjvn90lZ7AWhYApChd2gAKHzZqmnNz4xlURENSQasaw/edit#gid=0 and i want to get rows with some differences by unique values Id and Updated at.
List №1 i have the same automatic importing data http://prntscr.com/t3axvt
In List №3 i try to use =UNIQUE('List1'!A2:A;'List1'!D2:D) http://prntscr.com/t3ayx8 but it didn't work
Question
i need to get rows from List1 if there are duplicates with these parameters Id and Updated at first row from duplicate rows (must be like this http://prntscr.com/t3b3nb) or last row from duplicate rows (must be like this http://prntscr.com/t3b3nb).
You can create a helper column to achieve this
Create a helper column J and put the below formula in J2
=arrayformula(if(D2:D7=OFFSET(D2:D7,-1,0),"",ROW(A2:A7)))
Then you'll be able to filter your data, put below formula in A10
=FILTER(A2:J7,J2:J7<>"")
Please amend your data ranges per your requirement
Please use ; instead of , if you in are different continent
for Extended Range, use below formula
=arrayformula(if(D2:D="","", if(D2:D=OFFSET(D2:D1000,-1,0),"",ROW(A2:A))))

Align imported data with manual input data in a Google sheet

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

Sort the value of a column with a relative position (using an other column data order)

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.

Formula to search a range/array in Sheet2 for values in Sheet1 and return values found in Sheet2 but not in Sheet1?

I have three sheets. Sheet1 contains a column of data (player names), Sheet2 contains an array of player names associated with each other, and Sheet3 is currently blank. I'd like to figure out what formula to use in Sheet3 to search the array in Sheet2 for all names not in the column in Sheet1, and then return those in Column A in Sheet 3. Names in the array may be redundant, if that matters.
I'm unsure of the formula to employ; Index/Match doesn't seem to fit the bill, and neither does VLookup.
You can use an array MATCH to return an array of just the cells that do not appear in Sheet1 (other cells will be blank):
=ArrayFormula(IF(ISNA(MATCH(Sheet2!A:E,Sheet1!A:A,0)),Sheet2!A:E,))
Then you reach the main hurdle here, which is to convert a 2D range into a single column of values. This may be achieved with:
=ArrayFormula(TRANSPOSE(SPLIT(CONCATENATE(IF(ISNA(MATCH(Sheet2!A:E,Sheet1!A:A,0)),Sheet2!A:E,)&CHAR(9)),CHAR(9))))
Then, if you wish, you can convert that to just unique values:
=ArrayFormula(UNIQUE(TRANSPOSE(SPLIT(CONCATENATE(IF(ISNA(MATCH(Sheet2!A:E,Sheet1!A:A,0)),Sheet2!A:E,)&CHAR(9)),CHAR(9)))))

Resources