Google spreadsheet: use value as row number - google-sheets

I have a return value from a function in cell A1. Let's say it's 51.
How can I use this value as a row number. I don't want 51 in A1 but instead I want the value from cell A51 in cell A1.
Is there a formula?

Use indirect:
= indirect ("A"& 51)

Related

Google Spreadsheets, Insert a cell value to another cell

I don't know anything about scripts so I would prefer a function.
I have a table like this:
a1
b1
c1
a2
b2
c2
If "a1" = 1 a2 = today's date.
For example:
if I write to a1 cell a "1" it will "transform" into today's date,
if anything else nothing happens.
You can simply put this formula in A2 cell :
=if(A1=1,TODAY(),"")

Google Sheet cell value does not match

I am trying to compare to cell in google sheet. Both the cell contains Value "Saturday".
Cell A1 = TEXT(WEEKDAY(N1),"dddd") value is "Saturday"
Cell A2 = =B2 value is "Saturday"
but when I compare both =IF(A1=A2,"TRUE","FALSE") Result is FALSE. I tried changing both cell to plain text but it did not work. Any solution?

Check if each cell range in a row contains the same value

How can I check in Google Sheets if each cell in a range e.g. B2:G2 contains a word e.g. holiday?
=ARRAYFORMULA(IF(IFERROR(REGEXEXTRACT(B2:G2, "holiday"))<>"", TRUE))
=ARRAYFORMULA(IF(SUM(IF(IFERROR(REGEXEXTRACT(B3:G3, "holiday"))<>"", 1))=6, TRUE))

How do I get the row number of the last cell in a column,which is greater than zero?

I have tried with
=INDEX($K$2:K15,MATCH(TRUE,INDEX($K$2:K15>0,0),))
but this gives me the value of last cell in K row which is greater than zero.
How do I get the number of the row where last non-zero value lives?
Drag down
=INDEX(FILTER(ROW(K2:K15),K2:K15>0),1)
FILTER(ROW(K2:K15),K2:K15>0) is to get all rows where column values > 0. The index is to get the first one.
To get the last row number:
=INDEX(FILTER(ROW(K2:K15),K2:K15>0),COUNTIF(K2:K15,">0"))
This formula for row2: =INDEX(FILTER(ROW($K$2:K2),$K$2:K2>0),COUNTIF($K$2:K2,">0")). Drag down and see if it works. Gives #N/A if no rows were found
Single formula solution
=ARRAYFORMULA(VLOOKUP(ROW(K2:K16), QUERY(QUERY( { row(K2:K16) , IF(K2:K16>0,ROW(K2:K16),0) } , "select Col2, min(Col1) group by Col2"),"select Col2, Col1"), 2))
Paste in a cell from row2.

Google spreadsheet cell reference from value of another cell

This is the scenario:
In cell A1 I have value "12".
In cell B1 I enter value "1".
In cell C1 I want to have value of Column "A" and row defined in cell B1.
How can I display the value "12"?
=INDIRECT("A"&B1)
Help page for INDIRECT function: https://support.google.com/drive/answer/3093377?hl=en-GB

Resources