Say I have this named range, not at A1.
idz01 idz04 ida02 foo a 1 b bar c 3 8 baz 8 2 g
Now how can I get the first row? And Nth row? And how the Nth column? As a range, using the built-in functions.
Edit: Nth row: =OFFSET(ObjednavkyData, N,0, 1)
Last row:
=OFFSET(ObjednavkyData, MAX(ARRAYFORMULA(ROW(ObjednavkyData)))-ROW(ObjednavkyData), 0, 1 )
To use the HLOOKUP formula in Google Sheets, ensure that the row you wish to look through is at the top of the formula. Then utilize the formula =HLOOKUP(search-key, range, index, sorted) to look for a specific value in your spreadsheet.
Type the formula you want to use into the top-most empty cell in the column. Hover your cursor over the bottom right of the cell until it changes to a "+" symbol. Click and drag the box down the column until you apply the formula in the empty cell to every cell you require for the calculation.
Just use the INDEX
function:
=INDEX(NamedRange1,NRow,NColumn)
If you want the last row and column you can use:
=INDEX(NamedRange1,ROWS(NamedRange1),COLUMNS(NamedRange1))
INDEX
is more efficient than the alternative OFFSET
and INDIRECT
that are volatile.Examples:
=INDEX(ObjednavkyData,3,2) //This will return "c". =INDEX(ObjednavkyData,ROWS(ObjednavkyData),COLUMNS(ObjednavkyData2)) //This will return "g".
Addition:
If you want to get the whole row, you can omit the column
part of the INDEX
function. And if you need the whole column, omit the row
part (by putting 0
in the row
field).
=INDEX(ObjednavkyData,3) //This will return row 3: "bar c 3 8". =INDEX(ObjednavkyData,0, 2) //This will return column 2: "idz01 a c 8".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With