Ask Your Question
4

How can I retrieve the value of the last cell that contains data in a spreadsheet using importrange?

asked 2022-01-07 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-19 09:00:00 +0000

pufferfish gravatar image

You can use the following formula to retrieve the value of the last cell in a spreadsheet using Importrange:

=INDEX(IMPORTRANGE("spreadsheetURL", "sheetname!A1:Z"), MAX(FILTER(ROW(IMPORTRANGE("spreadsheetURL", "sheetname!A:Z")), IMPORTRANGE("spreadsheetURL", "sheetname!"&ROW(IMPORTRANGE("spreadsheetURL", "sheetname!A:Z"))&":Z")<>"")) ,MAX(FILTER(COLUMN(IMPORTRANGE("spreadsheetURL", "sheetname!A:Z")), IMPORTRANGE("spreadsheetURL", "sheetname!"&ROW(IMPORTRANGE("spreadsheetURL", "sheetname!A:Z"))&":"&COLUMN(IMPORTRANGE("spreadsheetURL", "sheetname!Z")))<>"")))

Replace "spreadsheetURL" with the URL of the spreadsheet, and "sheetname" with the name of the sheet you want to retrieve the data from.

This formula uses the INDEX function to look up the value in the last cell that contains data. It first imports the data from the specified sheet using IMPORTRANGE, then uses the MAX and FILTER functions to determine the row and column of the last cell with data. Finally, the INDEX function is used to retrieve the value at the specified row and column.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-01-07 11:00:00 +0000

Seen: 2 times

Last updated: Feb 19 '22