0

I have a question regarding the importrange() function. This is my formula:

=ImportRange("1u0TjjekVHHb6shYiSWoo0W1ygxuSu2tVvLstnEE1NFo";"Juillet!I5")

I have about 20 rows of data in the Juillet sheet. In order to quickly change the sheet in all the formulas, is it possible to get the sheet name in this formula through a reference to a cell?

For example, let's say that cell A1 contains a month name like Juillet or Novembre. How can I get the value in cell A1 embedded in an importrange() formula?

What I would like to do is something like this:

=ImportRange("1u0TjjekVHHb6shYiSWoo0W1ygxuSu2tVvLstnEE1NFo";"A1!I5")

1
  • Welcome to Web Applications Stack Exchange. Consider sharing a publicly editable sample spreadsheet with realistic-looking data, and showing your hand-entered expected results there. You can put all data in tabs in the same spreadsheet file. Explain clearly whether the data is actually in separate spreadsheet files or all in the same spreadsheet file. Jul 24 at 19:47
0

The second parameter to importrange() is just a text string, so you can concatenate the sheet name and the range reference like this:

=importrange("1u0TjjekVHHb6shYiSWoo0W1ygxuSu2tVvLstnEE1NFo"; A1 & "!I5")

One would usually get a range of cells with an importrange() formula rather than getting just a single cell. You may want to replace I5 with something like I5:K42.

If the source data is stored in tabs in the same spreadsheet file, and the target sheet is in the same spreadsheet file as well, do not use importrange() but the indirect() function or an { array expression }.

3
  • thanks a lot... I've try with A1 + "!K5", but doesn't work :) Jul 25 at 10:10
  • Instead of A1 + "!K5", use A1 & "!K5". Jul 25 at 14:10
  • yep.... i have tried and not i've try. After your comment I tried with & and you saved my life Jul 25 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.