Google Spreadsheet Import Range #REF! Error (Randomly) - google-sheets

This problem has been persistent for a while, just happens every so often at random times, nothing changing. I also do not know how to reproduce the problem, but I'll give a detailed explanation of what's happening.
Normally the importRange function works just fine, and looks something like the following:
The Spreadsheet key is typed correctly - I've been using this strategy in Google Spreadsheets for a while now.
Every so often, Google Spreadsheets seems to break down, or at least the importRange function does... and produces something like the following:
Google seemed to be freezing up at times today, which is when this happened. I've tried adjusting the importRange parameters to !X1:X, !X2:X5, changing the title of the Sheet that is being imported, etc.
In the past, changing from !X:X to !X1:X fixed some columns, but not always all of them. The only fool-proof solution to fixing this, that I have found, is recreating both spreadsheets. As the back-end (the one being imported) eventually becomes a report, I would like to spare my boss the extra effort of referencing multiple spreadsheets, and would rather just fix this and be done with it.
Does anyone know the potential cause of this glitch? Sometimes it fixes itself, sometimes it doesn't. It happens randomly, and only to certain spreadsheets (I have a set of 8 or so that all use importRange, and no more than 2 are ever affected at the same time). So I honestly have no clue where this is coming from.
Side note: Google in general has been a bit unresponsive today in terms of all its services - my university's App Engine email service was down for about half an hour. Could a limitation on resources/network attackers be causing this kind of behavior in Spreadsheets?
Update: I attempted to import to the same Spreadsheet data from a different Spreadsheet (i.e., gave the importRange function a different Spreadsheet key). Though the key and range are valid if imported into a different Spreadsheet, in my original (the one full of #REF!), that range is not imported correctly. This leads me to believe that this glitch may apply only to a single Spreadsheet, where any attempt to importRange from any other source is not functional.

This is a little late, but I came across it in a search so it might help someone else - try something like this:
=IFERROR(ImportRange(SpreadSheet_GUID,"Bookings!P:P"),
IFERROR(ImportRange(SpreadSheet_GUID,"Bookings!P:p"),
IFERROR(ImportRange(SpreadSheet_GUID,"Bookings!p:P"),
ImportRange(SpreadSheet_GUID,"Bookings!p:p"))))
Basically the idea is to force Google to recalc using variations of the original address (upper/lower case column letters).

The problems with the IMPORTRANGE() function has been somewhat of an ongoing issue. There have been several bugs over the years and it is up to Google to find a stable solution so it works as designed.
Until then, this might help you:
Instead of editing the cell, creating a new spreadsheet, or doing anything else to have the sheet reattempt the function (almost like playing lottery), you can force Google sheets to reattempt the function automatically when it fails to load:
Wrap the IMPORTRANGE() function that is causing problems with an IFERROR() function. That way, the sheet attempts the import, and only if it fails, it attempts it again. The function can be nested to attempt several times in a row.
You can add named ranges to your source data (right-click-source>define-named-range) to facilitate. For instance, you can create 3 different named ranges for the "J:J" range. Call them "J", "Ja", and "Jay", then you call on your IFERROR() function in the sheet you want to import to:
=IFERROR( IMPORTRANGE( "SheetID","J" ), IFERROR( IMPORTRANGE( "SheetID","Ja" ), IFERROR( IMPORTRANGE( "SheetID","Jay" ), IFERROR( IMPORTRANGE( "SheetID", "'TabName'!J:J" ), IFERROR( IMPORTRANGE( "SheetID", "'TabName'!j:j" )))))
This formula will attempt your import and deliver it if it succeeds, and if not reattempts a total of 5 times in a row automatically, which doesn't guarantee you will succeed, but if you have a 50% chance of success with your imports, nesting 5 in a row should give you a 96% chance, which is a lot better. My personal experience has been that it hasn't failed since I've done the IFERROR() nest.
Hope it helps.

I had similar issues, and were resolved by NOT using public links to spreadsheets.
I have noticed that links are different for public sharing and those coppied from address bar while sheet si opened.
Also i have noticed some difficulties while opening shared spreadsheets from my other Google accounts. I had to re-allow access for some spreadsheets that i was importing.
Sorry for my english.

This happens, indeed, in my case simply Ctrl+X, waiting for a second, and then pasting the formula back makes the Sheets engine re-do the import and then it succeeds to import.
In case you can not do this procedure manually, you should use Tim's solution.

I found this solution, work fine for me:
In both spreadsheets insert an =now() equation in a random cell, say Z1
In both spreadsheets insert an =importrange() function that references the now function of the other spreadsheet.
Go into your spreadsheet settings and choose to recalculate every minute.
I tried a lot of other suggestions including using the =now() function, the now URL trick in this thread, or Apps Script to insert random text on a set interval, but nothing would force importrange to update except a manual edit of the source sheet.
https://webapps.stackexchange.com/questions/60324/how-can-i-get-google-sheets-to-auto-update-a-reference-to-another-sheet

I had the same issue, and found a solution!
Please reduce the source file's size
To reduce, split it up and again have the import-range referenced
You now will be able to see the imported range!
If you think the above isn't the situation, the chances might be
Your cell is occupied so remove all formatting and clear all the cells before importing the range.
Still not working? Let God help you out!

I tried adding :
if(ISERROR(importrange...
and it works.
It doesn't mean the error disappears, but when it happens, you just need to reload the sheet and wait for while and let it update itself.
It is much more practical than manually changing the big letter to small letter.

Here's the easy work-around I've found for this bug:
I do a Find-and-Replace ("search within formulas") for "=" wherever I have the importrange error (=REF!) (or just for the whole sheet) and I replace-all with a "#" in order to make it all be text rather than formula. Then I do another Find-and-Replace over the same area and replace-all the "#" with "=" again. This consistently fixes the issue.

I was able to fix the =REF! error using the Edit > Find and Replace > Find "=" Replace with "#" > Search Selected Range > Also search within formulas > Find > Done. The error corrected without actually initiating the Replace command.

just to share with you how I resolve this error.
Upon checking on my formulas, I have a Circular Reference, which made me encounter this ImportRange internal Error. When I clean my formulas to remove those circular references, it worked again. :)

I had the same problem and solved it by using
=IF(ISERROR(A1);IMPORTRANGE();IMPORTRANGE())
in the cell where earlier IMPORTRANGE used to be and by turning on Iterative calculation in spreadsheet’s location & calculation settings.
Hope it help someone

Related

Google sheets, two-sheet dependent conditional formatting

My problem is probably trivial ... However, I was looking for similar problems and their solutions either do not work for me or I can not apply them.
I have 2 sheets - SheetA and SheetB. They are identical. I want to select every cell in SheetA that is no longer identical to Sheet B.
I was able to use (found here on Stack Overflow) such a function in conditional formatting:
= A1 <> INDIRECT ("SheetB! A" & ROW ())
It works if the range is column A. I know that I can apply this function to each column separately, but there is certainly a way that I can apply the same formula to the whole worksheet.
Will there be anyone who can show me the correct formula?
Edit: I tried to use above formula to every column... And my file become to work very slow... So whoever wants to do the same... think again.
After some tries I decided to move everything from SheetB to SheetA. I paste it a 1000 rows under data of Sheet A. Works fine without "indirect" function. No slow downs. It is not a perfect solution but it works.
But even after my problem is solved different way, I would like to know what is the correct formula for my problem... it might be useful for the future with smaller amount of data.
Solved ;)
You should be able to use the Address function to get the address of the current cell from its row and column:
=A1<>indirect("sheetB!"&address(row(),column()))
or for case-sensitive match:
=not(exact(A1,indirect("sheetB!"&address(row(),column()))))

Google sheets Import Range

I don't think that importrange is a real formula I have spent hours on this and it doesn't work full stop.
The sheet name of the data I wish to import is Fire Safety Audit but it was originally sheet 1
=importrange(https://docs.google.com/spreadsheets/d/18B8KclREhEvOm9ZeOEEfpFSkTol1uxwlCt8kVfptO6I/edit#gid=2093530965";"fire safety audit"!A1:w1000")
=importrange(https://docs.google.com/spreadsheets/d/18B8KclREhEvOm9ZeOEEfpFSkTol1uxwlCt8kVfptO6I/edit#gid=2093530965";"sheet1"!A1:w1000")
I have tried so many different types of formulas with colons, commas and semi colons.
Every time no matter what I try the number 2093530965 remains in blue font and it says I have parse error. Not quite sure why Google make this so complicated and do not have any help for it whatsoever. In summary its crap.
I use importrange literally everyday for work, it definitely is a real formula ;) that said your main issue from those examples is that you are missing a " infront of your url, google sheets formulas are also command delimited not semi colon as in open office. Finally, you're entire sheet and cell reference needs to be in 1 set of quotes.
Example -
=importrange("https://docs.google.com/spreadsheets/d/SOMEID","SheetName!A:Z")
Once you have done that you are going to get a permissions error because you need permission to import data (even if you own both sheets). To fix this, hover over the cell with the error and click "Grant Access".
Try using the formula with the syntax in the documentation:
Syntax
IMPORTRANGE(spreadsheet_url, range_string)
So, if your Sheet is named Sheet1 change from this:
=importrange(https://docs.google.com/spreadsheets/d/18B8KclREhEvOm9ZeOEEfpFSkTol1uxwlCt8kVfptO6I/edit#gid=2093530965";"sheet1"!A1:w1000")
To this:
=importrange("https://docs.google.com/spreadsheets/d/18B8KclREhEvOm9ZeOEEfpFSkTol1uxwlCt8kVfptO6I/edit#gid=2093530965";"sheet1!A1:w1000")

sheets giving importrange internal error but loads data on formula refresh

we have several sheets that rely on importrange to get data from other google sheets, beginning this week we have had trouble getting some of them to load, we just get #ref import range internal error.
I have tried a wide variety of solutions but all of them seem to only work temporarily whereupon refreshing the query it will sometimes manage to get the data, the size of the range is not the problem since the problem happens in large imports as well as imports that only get 1 cell.
so far the best solution I have is deleting the = from the formula and then adding it back to force the data to load again however this only lasts for around 30 min before the importrange goes back to giving the same error.
the formulas aren't anything fancy
=IMPORTRANGE("sheet url","Update_Guide!b2:n2")
I have tried variations of capital letters for the ranges, as well as adding if error to try and load a variation of the formula
=iferror(IMPORTRANGE("sheet url","Update_Guide!b2:n2"),
IMPORTRANGE("sheet url","Update_Guide!B2:N2"))
but nothing seems to work, or when it works the solution doesn't seem to stick.
any help or insight into what may be causing this problem would be greatly appreciated.
IMPORTRANGE has a limitation of 50 formulas per spreadsheet if you are using the old version of Google Sheets. if that's not the case you may have broken spreadsheet (it happens). in either case, try to create a fresh new spreadsheet and add your formulas there...
https://docs.google.com/spreadsheets/create
The suggestion by player0 to delete the = sign and type it back in is a good suggestion. Though it did not work for me, it gave me the idea to delete "range" from "importrange" - hit enter - delete what was added and retype "range" into "importrange" Work perfectly. All my cells in the chart returned.
Thanks for the tip.

Google Sheets - Vlookup not updating formulas automatically when new sheet reference is created [duplicate]

I have this formula in a cell in a 'Summary' sheet which is waiting for a new sheet to be created with its name being a date:
=IFERROR(VLOOKUP($A3, INDIRECT("'"&TEXT(BN$2,"m/d/yyyy")&"'!$E$6:$o$100"), 11, false), "")
However, when I add the new sheet with the name that would match, then it doesn't automatically recalculate and pull in the values from the new sheet.
The weird thing is if I add a column to the left of this column that has the formula shown above, then it recalculates ... and all is well. Another weird thing is if I add a column far enough away from the column in question then it doesn't recalculate in the same way that it does when I add a column near the column in question (hmmmm....).
What is going on here? And how can I work around it? Seems Google has some major bugs around this area or something ...
This is due to INDIRECT.
A partial workaround:
=IFERROR(INDIRECT("'"&C9&"'!A1"),RAND())
Use this instead of just INDIRECT in your formula. It still won't update on opening and closing. But it'll update, Whenever there's a edit anywhere in the sheet (making this a double volatile combo with RAND()).
Also, Try turning on recalculations every 6 hours or so in spreadsheet settings.
PS: Your Spreadsheet might burn🔥🔥 due to the heavy volatility.
Sorry for the late response, but I believe I have a solution that works a little better. I was experiencing the same problem with formulas involving almost exactly the same set of formulas.
Basically, just add in a check to see if now() equals an impossible time (0), and when it fails (every time), have it execute the formula that won't update on its own.
=IF(NOW()=0,"",
IFERROR(VLOOKUP($A3, INDIRECT("'"&TEXT(BN$2,"m/d/yyyy")&"'!$E$6:$o$100"), 11, false), "")
)
based on idea similar to TheMaster I defined a named range refresh and refered to it in the else portion of the IFERROR formula.
Whenever I create a new sheet, rename an existing one, or feel the need to make sure all indirects are updated I simply edit the content of refresh, and put it back to blank.
=arrayformula(iferror(indirect(B11&"!D42:H42");refresh))
I used Berteh's idea, but found that putting the refresh range within the else portion of the iferror removed the benefit of having a way to have a blank cell if there is no value, or what ever else you'd want to use the else for.
So, to maintain that, I put this together which seems gets us the benefit of preserving the benefit of using iferror and forcing the indirect to update.
=IF(refresh!$A$1=1,IFERROR(VLOOKUP($B68,INDIRECT(D$66&"A1:aa2000"),8,0),""))
Updating the value of the refresh range will force a recalculation (I change the value of cell A1 from 1 to a 0 and then back to 1). I've implemented this on multiple rows across multiple sheets and not found this to blow up the Google Sheet.

"Unresolved Sheet Name" errors randomly shown across my cells

This started happening to me today, almost randomly my functions show "Unresolved Sheet Name". I have to go into the function, as if I was editing it, and just hit Enter and it works like normal. The issues is I have thousands of functions across several sheets and they keep intermittently "breaking" on their own terms.
This is similar to: Google Spreadsheet Import Range #REF! Error (Randomly).
I have a spreadsheet holding a large chunk of data which I import to the current spreadsheet I'm using. I then reference the worksheet I used to importrange the data into. The reference to that worksheet will intermittently break.
I see no reason to paste my functions, since they do work as long as this #REF error does not show up.
Is this a known bug?
I've had this happen before in the past, and eventually resolved to just "refresh" all my functions every time this happened. In this case, the spreadsheets are client facing and need to be reliable so I don't have that option.
Any way to "refresh" all my functions without going through them one at a time?
I had a similar issue that I corrected with script. My spreadsheet references sheets that aren't yet created. This results in a "ref" error as expected. However, when I create the sheet, the "ref" error only goes away when I click in the cell and then hit "enter."
Since I had already written a script to update my sheet monthly, I added the following to the end (I only needed to update 12 cells, hence the range):
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Random Notes/Calcs");
var formies = ss.getRange(31, 24, 12, 1).getFormulas();
ss.getRange(31, 24, 12, 1).setFormulas(formies);
In summary, get your range, then get the formulas, and then set the formulas to the same range. I'm sure there is a better way. Hope this helps.
I have some time working with google sheets, the issue I've have is in the Import Range #REF! Error (Randomly)
Fine, the solution I found is using the ** RANDBETWEEN** and MOD
Try this
=IF(MOD(RANDBETWEEN(0,10),2)=0,IMPORTRANGE("SheetID","Sheet!a:Ab"),IMPORTRANGE("SheetID","Sheet!A:Ab"))
With the Changes, the rand formula will recalculate the number. If you see, the Range of the sheet change A by a.

Resources