New Tool Radar

AI for Data & Spreadsheets

How to Check the Allow Access Step an AI-Written IMPORTRANGE Formula Needs

Check the Allow access permission step an AI-written IMPORTRANGE formula needs before it returns data.

Schematic with three steps: Read the error on the formula cell; Allow access from an account that can; Check the imported rows against the source.

IMPORTRANGE pulls a range from another Google Sheets file, and the first time a file reads from a new source, the cell shows #REF! until someone with access to the source clicks it and chooses Allow access. An AI-written formula can be correct and still show an error, because the permission step was never done. Check the permission before rewriting the formula.

What you need

  • The AI-written IMPORTRANGE formula and the source file’s address
  • Access to the source file for the person who will allow it
  • The range the formula should import

Step 1: Read the error on the formula cell

Click the cell showing #REF! and read the message. If it asks to connect the sheets, the formula is waiting for permission, not broken.

Step 2: Allow access from an account that can open the source

Click the cell and choose Allow access, using an account that can open the source file. Only someone with access to the source can grant it; a viewer of the destination alone cannot.

Step 3: Check the imported rows against the source

After allowing access, count the imported rows and check the first and last against the source range. Remember that the connection covers the whole source file, not just the named range, so keep the destination’s editor list short.

Worked example: synthetic monthly import

The table below is a synthetic example. It shows the expected result of checking an AI-written IMPORTRANGE formula; no formula was run.

Check Value Result
Formula used IMPORTRANGE(url, “Monthly!A2:D4”) Three rows expected
Cell shows before allowing #REF! Waiting for permission
After Allow access 3 rows Matches the source
Connection covers Whole source file Not just the named range

Expected result (UNTESTED). the IMPORTRANGE formula shows #REF! until Allow access is clicked by someone who can open the source; after that it returns the three rows from Monthly!A2:D4. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • Each source file needs its own Allow access step; allowing one file does not allow another.
  • The access lasts until the person who allowed it is removed from the source file.
  • Any editor of the destination can write a new IMPORTRANGE to any part of the source file once access is allowed.
  • IMPORTRANGE checks for updates about once an hour while the file is open, so changes arrive with a delay.

Sources

See all