Referencing a cell into a formula - google-sheets

This question pertains to Google Sheets. In column F of one "List" tab of my sheet, I have the name of all the other tabs in my sheet. All the other tabs contain information specific to one single topic. Im trying to get all of column N in "List" to pull up cell G2 of each sheet. So far, ive been using this:
='(sheet name)'!G2 ;in the N column, changing (sheet name) manually and individually
But I'd rather have the content of the F fill the (sheet name) part of the formula. Any way to do so?

With sheet names in column F, in N1 enter:
=INDIRECT("'" & F1 & "'!G2")
and copy down. Please note the single quotes in the formula.
This should work for both Excel and Google Sheets.

Related

Google Sheets Add Formula Automatically After New Row

I'm using Zapier to automatically send data to a google sheet and I'm looking for a solution that allows me to automatically add the formula I want in a column when a new row is added.
For example: In column K I'm using this formula:
=VLOOKUP(J2,'List of Employees'!A:B,2,false)
This VLOOKUP function is working properly but only if I double click and expand the formula.
How I can automate this and pass the formula to the next new row created by Zapier?
Clear column K and then enter in K2
=ARRAYFORMULA(IF(LEN(J2:J), VLOOKUP(J2:J,'List of Employees'!A:B,2,false),))
This formula should not be dragged down as it processes all contents of column J and create an output in column K.
I hope that helps?

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))})

Looking for workaround where Google Sheets QUERY function turns numbers into text . .

I've been researching all morning and haven't been able to find a way to make this work. Example Spreadsheet I have a form (created as a student test) that feeds a spreadsheet with 160+ questions; therefore columns. I'm using a transpose/query function to bring the data into another tab so I can begin the analysis. The problem is, when the data comes into the new tab =query(transpose(query('Form Responses 1'!$A$2:$FF$2,"Select *",1))), it turns all the numeric scores into text. I believe it does this because there are string values as well. I would like to filter those out, but no luck there either. Does anyone know of a work-around for this? Or can recommend a better way? THANK YOU!
I'm not sure what you're trying to do exactly, but if you just want to transpose the 'Form Responses 1' data and convert columns E and F to a numeric, then you could try the following.
Create a new tab called 'Cleaned'.
In cell A1 enter ={'Form Responses 1'!A1:FN1}
or to remove 'Option ' from the headings:
=arrayformula(substitute({'Form Responses 1'!A1:FN1},"Option ",""))
In cell A2 enter =arrayformula({'Form Responses 1'!A2:D,value('Form Responses 1'!E2:F),'Form Responses 1'!G2:FN})
Then on your 'Transpose Data' tab, in cell A1, enter:
=transpose(Cleaned!$A$1:$F$5)
In cell A7, enter:
=transpose(Cleaned!$G$1:$FF$5) * see below
Make sure there are no formulas below cell A7 or in columns B to E.
*If you want unique values in the transposed columns A to E, then in cell A7 use:
unique(transpose(Cleaned!$G$1:$FF$5))
If you only want unique values in column A, then you could create another tab, say 'Transpose Data2':
In cell A1:
=unique('Transpose Data'!A:A)
In cell B1:
=arrayformula(iferror(vlookup(A1:A,{'Transpose Data'!A:E},{2,3,4,5,6},false),""))
It won't keep your G1, G2, G3 rows together, but that will need a sort column creating on the 'Transpose Data' tab.

Trouble with a single cell formula being converted to a full column formula

I have a Google Sheet that has a Google Form populating the results of many games that a friend and I play. I have created a new column and added a formula to the top cell in that column and just copied it down the column:
=JOIN(" / ",(FILTER(MyDecks!B$2:B,MyDecks!A$2:A=B5)),(FILTER(HisDecks!B$2:B,HisDecks!A$2:A=C5)))
MyDecks column A is a list of deck names.
MyDecks column B is an attribute of each deck, which is the desired return value.
B5 and C5 are both within columns of the Sheet tab where the formula exists.
The output when using the formula above is something like "M / P", for example.
This formula however, currently has to be copied and pasted, or just extended down to the new cells any time I add another entry with the Google Form.
I would like this formula to be altered so that it will function the same as it does currently, but have it reside within the column head itself so that new entries will just accept and render the formula automatically for the new entries that I create.
I have tried:
=ArrayFormula(IF(ROW(D:D)=4,"Matchup",IF(ISBLANK(C:C),"",JOIN(" / ",(FILTER(MyDecks!B$2:B,MyDecks!A$2:A=B$5:B)),(FILTER(HisDecks!B$2:B,HisDecks!A$2:A=C$5:C))))))
and many other iterations of the same idea, to no avail. I am a novice and am hoping that there is an easy solution to my issue.
use:
={"Matchup"; ARRAYFORMULA(IFNA(
VLOOKUP(B5:B, JoeDecks!A2:B, 2, 0)&" / "&
VLOOKUP(C5:C, BryanDecks!A2:B, 2, 0)))}

Take values from column and put into a row

In google docs I am tryignt to take the values from a column in one sheet and use them as column headings in another sheet without duplicates.
Thus if sheet1 has
a
a
b
f
g
g
Sheet 2 should have it as
a b f g
In Excel I would just use VBA code, how do I do it in a google sheets?
I know the command to get it into a column, but not into a row
=unique(sort('Acumen Lead Tracker'!X3:X64,1,true))
Thanks
Try in Cell A1 of the second sheet:
=transpose(unique(Sheet1!A:A))
where Sheet1 is the sheet where the values you want to use as headers are found in col A.

Resources