Any way to autofill links in Googlesheets - google-sheets

I have a Googlesheet with 2 tabs containing 148 rows of member information.  I have created a link in Cell P3 in Tab A which when clicked takes me to the relevant cell in Tab B.  My query is ....is there any way of copying/auto filling this link formula in Cell P3 for all 148 rows rather than having to manually create the link for all 148 members? Copy/Paste or auto filling doesn't seem to work for links.
Thanks!

You can try this HYPERLINK() to insert links:
=HYPERLINK("https://docs.google.com/spreadsheets/d/XXXXXXXX/edit#gid=xxxxxx&range="&address(row($A1),1,4),"CellLink")
What you need to do?
Replace the sheet URL until gid=xxxxxx
Replace the row and column index in ADDRESS() based on your preference.
What it does?
It creates a hyperlink that will link to a specific cell by appending &range=<A1 notation> to the sheet's url
ADDRESS() will return an A1 notation based on the row and column index that you provide. In this example, I want to increment the row index. I used ROW() and reference to A1 so that the row index returned will be 1.
If you drag-down the formula, it should look like this:
= HYPERLINK("https://docs.google.com/spreadsheets/d/XXXXXXXX/edit#gid=xxxxxx&range="&address(row($A1),1,4),"CellLink")
= HYPERLINK("https://docs.google.com/spreadsheets/d/XXXXXXXX/edit#gid=xxxxxx&range="&address(row($A2),1,4),"CellLink")
== HYPERLINK("https://docs.google.com/spreadsheets/d/XXXXXXXX/edit#gid=xxxxxx&range="&address(row($A3),1,4),"CellLink")
so on..
Output:

Related

Transpose a table row by row

I need to transpose parts of a table row by row. The following example illustrates what the result needs to look like:
I tried different combinations of arrayformula(), flatten() and transpose(), succeeded with getting the last column right with =arrayformula(FLATTEN(B4:C)), but need now help with fixing this.
Link to table
Try this in row 2 of the example screenshot:
={flatten({A2:A,A2:A}),arrayformula(flatten({if(A2:A<>"",B$1,),if(A2:A<>"",C$1,)})),flatten({B2:C})}
Or if you want the column headings, put this in row 1:
={"A","B","C";flatten({A2:A,A2:A}),arrayformula(flatten({if(A2:A<>"",B$1,),if(A2:A<>"",C$1,)})),flatten({B2:C})}
The new column 'C' ends up being a mixed data type, so be careful if you run a future query on these results as it doesn't like mixed data.
For local implementation (as per your initial screengrab, EU locale file), try this in cell E4 - since the formula sits in row 4, the array range needs to go from 4 (A4:A):
={flatten({A4:A\A4:A})\arrayformula(flatten({if(A4:A<>"";B$3;)\if(A4:A<>"";C$3;)}))\flatten({B4:C})}
Alternatively, if you want column headings, try this in cell E3 - the array range is still A4:A because "A"\"B"\"C"; puts headings in row 3, ; is a return, then the rest of the formula targets data from row 4 down:
={"A"\"B"\"C";flatten({A4:A\A4:A})\arrayformula(flatten({if(A4:A<>"";B$3;)\if(A4:A<>"";C$3;)}))\flatten({B4:C})}
If you want to limit the array range to a specific row rather than working down the entire sheet (eg. row 20), then A4:A would need to be A4:A20.
This is a basic SPLIT(FLATTEN( problem.
Arrayformula() can always exist on the outside of a formula and will apply to the whole thing.
This is on a new tab in your sample called MK.Help:
=ARRAYFORMULA(QUERY(TO_TEXT(SPLIT(FLATTEN(Data!A2:A&"|"&Data!B1:C1&"|"&Data!B2:C);"|";0;0));"where Col1<>''"))

Automatically Change Sheet Reference in formula

I have hundreds of sheets, with one master sheet, and I have this formula in my master sheet
=IF(COUNTIF(Sheet2!M$2:M$11,"No")>0, "Y", "N")&COUNTIF(Sheet2!M$2:M$4,"No")&COUNTIF(Sheet2!M$2:M$7,"No")&COUNTIF(Sheet2!M$2:M$11,"No")
which basically grabs the number of yes or nos in a column from the referenced sheet, in this case 'Sheet2', and returns Yes, if there are multiple NOs in the column, and the other arguments just return the count of NOs in the cell ranges.
I just want to drag down the formula in the column it is located in, and have the Sheet reference change from Sheet2 to Sheet3, Sheet4, and so on, but it simply copies it down the column. I've tried looking into it, got some hints with using INDIRECT but I'm returning errors left and right that I'm not sure if I'm on the right track.
EDIT: sample data: https://docs.google.com/spreadsheets/d/1jcbjUs4Ho0LlXF-Olu5NkEw4THqaA0nB5dduYKfx5S8/edit?usp=sharing
I have successfully used below formula to count "No's" using a sheet reference from a cell. Try it out:
=IF(COUNTIF(INDIRECT("Sheet" & A1 & "!" & "A:A");"No")>0;"Y";"N")
You can change the column range to suit your need - I just used column "A" in each sheet and cell "A1" with the sheet reference, in the above case A1 contained the number 2 referring to "Sheet2".
You can replace the Sheet2!M$2:M$11 with the following:
INDIRECT("Sheet"&ROW()-1&"!M$2:M$11")
You have of course to replace the M$2:M$11 with the respective range references.

Google sheet formula that finds row name and returns column headers based on marked cells

I'm trying to return the column headers for a row that is marked with an x. The row is selected from a name in the left column. I'm stuck here.
I can illustrate what I want to do by showing these images:
Start table
The result I want is this:
Outputs of the possibilities for the first sheet
I have put more information in my Example Sheet.
Link to editable example sheet
This formula should create a table (with a single formula) with the months in one column and the headers in the second column.
=ArrayFormula({A4:A15\ substitute(transpose(query(transpose(if(B4:G15="x";B3:G3&char(10);));;rows(A4:A15)));" ";)})
If you'd want to 'lookup' the months you manually type in you can wrap the above in a vlookup. Example:
=ArrayFormula(if(len(L4:L); vlookup(L4:L; {A4:A15\ substitute(transpose(query(transpose(if(B4:G15="x";B3:G3&char(10);));;rows(A4:A15)));" ";)}; 2; 0);))
You can check out both formulas in the copy of the sheet I've made in the spreadsheet you shared.

Search for specific cell in Google Sheet

I am trying to address a specific cell of which I am not sure of neither row nor cell number. For instance, I would like to find row, which first column contains "211001" and column which contains "vybr. obd.". Then select the cell that corresponds to these: 123,00.
Is it feasible to address the rows like this?
Let's assume simple table:
Let's also assume the item number you want to look up is in B8 and the Metric to look up in B9.
Spreadsheets doesn't support wildcards in match statements but we can create a range that contains the extracted values with REGEXEXTRACT:
=INDEX($A$2:$D$5,
MATCH(B8 & "", ARRAYFORMULA(REGEXEXTRACT($A$2:$A$5, $B$8 & "")), 0),
MATCH(B9, $A$1:$D$1, 0))
In your case where the data is on the next row just add a + 1 to the second parameter of index.
B8 & "" is done because we need to coerce the field into a string without changing its representation.

Index row formula error on Google spreadsheet

I have a formula in Google spreadsheet from cell B2 all teh way to B100 which is
B2=iferror(INDEX(DB!$B:$AC,SMALL(IF(DB!$B:$AC=$A$1,ROW(DB!$B:$AC)),ROW(1:1)),0), "")
B3=iferror(INDEX(DB!$B:$AC,SMALL(IF(DB!$B:$AC=$A$1,ROW(DB!$B:$AC)),ROW(2:2)),0), "")
B4=iferror(INDEX(DB!$B:$AC,SMALL(IF(DB!$B:$AC=$A$1,ROW(DB!$B:$AC)),ROW(3:3)),0), "")
B5=iferror(INDEX(DB!$B:$AC,SMALL(IF(DB!$B:$AC=$A$1,ROW(DB!$B:$AC)),ROW(4:4)),0), "")
..
...
......
So it is pulling up values from a second tab which is named as "DB".
The Index row formula looks for the status "Completed" ( which is on cell A1) and return the details for all completed from the DB.
Google spreadsheet
main spreadsheet
Database in tab 2 (DB)
DB
The formula works fine , however i am getting duplicates of every cell which got the status "Completed "
Attached links to the screen shots for your reference.
Don't know what i am missing. 0_o
Thanks
I think you can use QUERY() for what you try to achieve.
Have a look at this example sheet and check sheet 2 where this formula is used to filter the data from sheet 1:
=query(Sheet1!A:H, "select * where B = '"&A1&"' ")
(where A1 is a drop down list with the values 'COMPLETED', 'in progress', 'resolving').
See if that helps ?
there is no need for formula here.
This is simply done by filtering:
Supposing you have a DB sheet like this
In your main sheet, put DB!A1 in cell A1, and drag and fill horizontally and vertically, to copy exactly your DB sheet into main sheet (you can do this selectively as well, there is no need to copy every column, just cpy those you want). Then click on FILTER, you can find it in SORT AND FILTER, then you will see a dropdown menu on all of the column headers. Simply by clicking on your status header, you can selected completed and press OK, it will ONLY show rows with completed on their status column.
And here is the link to download this example sheet
your links don't work for me.
You should use the FILTER() function, that is designed exactly for this purpose:
in cell A2 on your second sheet use: =filter('DB'!B:AC,'DB'!B:B=$A$1)
As suggested I would use Data validation with dropdown list, so that only valid statuses may be chosen.

Resources