Google Sheets' IMPORTXML breaks randomly - google-sheets

I'm writing since I'm experiencing some issues with the following IMPORTXML formula in Google Sheets:
=IMPORTXML("http://xmltestmagicplan.000webhostapp.com/xml_test.xml","/catalog/book[2]")
The formula works fine most of the times but approximately once a day it breaks, showing an error in loading the formula and giving #N/A as a result.
The workaround is changing anything in the URL (i.e. http -> https or 000webhostapp.com -> 000webhostapp.org) and then changing it back. Basically I think the workaround is forcing Google Sheets to reload the formula.
The same thing happens if I use this formula:
=IMPORTXML("http://xmltestmagicplan.000webhostapp.com/xml_test.xml")
No problem instead with the following formulas:
=IMPORTXML("https://gist.githubusercontent.com/Ram-N/5189462/raw/46db0b43ad7bf9cbd32a8932f3ab981bd4b4da7c/books.xml","/catalog/book[2]")
=IMPORTXML("https://gist.githubusercontent.com/Ram-N/5189462/raw/46db0b43ad7bf9cbd32a8932f3ab981bd4b4da7c/books.xml")
I think the issue is due to the hosting (000webhostapp.com) I'm using but I can't figure why. Any ideas?

you can try to trick it like this:
=IFERROR(
IMPORTXML("http://xmltestmagicplan.000webhostapp.com/xml_test.xml", "/catalog/book[2]"),
IMPORTXML("http://xmltestmagicplan.000webhostapp.com/xml_test.xml", "/catalog/book[2]"))
or if the switch is too fast add 1 fake switch between like:
=IFERROR(IFERROR(
IMPORTXML("http://xmltestmagicplan.000webhostapp.com/xml_test.xml", "/catalog/book[2]"),
IMPORTXML("http://xmltestmagicplan.000webhostapp.ORG/xml_test.xml", "/catalog/book[2]")),
IMPORTXML("http://xmltestmagicplan.000webhostapp.com/xml_test.xml", "/catalog/book[2]"))

Related

Google Sheets: ArrayFormula: Add Previous Value Err If First Value Is Text

The ArrayFormula I'm using is doing a cumulative calc, so col D is cumulative... eg =D1+C2 etc. Works fine when I create the ArrayFormula except for the first calc - since D1 is a header (text), not a number.
I tried an IF(), to check IsNumber(), but no good, same error. Any suggestions on how to correct this error?
Sorry, just fixed it. I had tried to use IFERROR(), but did it incorrectly before, now works when I use:
=ArrayFormula(iferror(D1:D1957+C2:C1958,C2:C1958))

Sumifs #ref error in google sheet - unexplainable

I have this very strange error which makes no sense to me.
I am using below formula to sum up sales values based on 2 criteria (one being month and the other one category)
=sumifs(Sales!$S:$S,Sales!$H:$H,D3,Sales!$Q:$Q,$A$12)
This formula works absolutely fine if I set cell D3 to 52020 (i.e. sum up all sales for may) - however, if I change the value to 62020 I am getting a ref error (same if I enter the value directly into the formula rather than using a cell). I tried other values and it looks like that only 62020 produces an error.
There are sales with 62020. In any case, this makes absolutely no sense to me especially given the error seems to come due to a Criteria not a range/ref.
I wonder if this is a bug (but probably I am missing something). Any ideas?
could be that for some reason your sheets converts it to date
62020 = 10/19/2069
try:
=INDEX(SUMIFS(Sales!S:S, Sales!H:H*1, D3*1, Sales!Q:Q, A12))

Google spreadsheet googlefinance get specific attribute does not work

The googlefinance integration, documented here, in google spreadsheets does not seem to work for me:
Example:
GOOGLEFINANCE("GOOG","price",TODAY()-30,TODAY())
Google spreadsheets gives the cell a red corner and prints the following message:
Fel i formeltolkning. which in english means something along the lines of Error in formatting.
The following does however work: =GOOGLEFINANCE("GOOG").
Also I can open other spreadsheets from links where the exakt same syntax seem to work. What can cause this?
Change comma to a semicolon.
GOOGLEFINANCE("GOOG";"price";TODAY()-30;TODAY())
Some regions (Norway!) use a comma for decimals. The other option is to change settings:
File > Spreadsheet Settings > Locale...

ARRAYFORMULA VLOOKUP with ISBLANK in google sheets

I am trying to get a VLOOKUP to work on an entire column (minus the header), but I want blank entries if the column I am searching for is empty. I tried both these formulas, but to no avail (I still get the N/A in empty cells):
=ARRAYFORMULA(IF(ISBLANK(VLOOKUP(O2:O,Sheet1!B:C,2,FALSE)),"",VLOOKUP(O2:O,Sheet1!B:C,2,FALSE)))
=ARRAYFORMULA(IF(O2:O<>"",VLOOKUP(O2:O,Sheet1!B:C,2,FALSE)),"")
This is a slightly more complicated way than what I got working in another part of my sheet, which is the same without the VLOOKUP:
=ARRAYFORMULA(IF(ISBLANK(J2:J),"",J2:J))
Any ideas what am I doing wrong?
If you want to leave a blank instead of #N/A in a cell, you can use =IFERROR.
Like this:
=IFERROR(Your_formula, "value if the formula returns an error")
Since you are using ARRAYFORMULA, the iferror must be inside it
=ARRAYFORMULA(IFERROR(VLOOKUP(O2:O,Sheet1!B:C,2,FALSE),""))

Formula Parse Error in Google Spreadsheet Sparkline

I'm having some trouble using the SPARKLINE function on Google Spreasheets. If I use the "default" formula, like =SPARKLINE(C9:N9), it works nicelly. But, everytime I try to add some extra options, like using columns instead of lines, for example =SPARKLINE(C11:N11;{"charttype", "bar"}), I get a "Error, Formula parse error." message.
Has anyone here had the same problem? Any idea of how can I fix it?
Thanks!
From https://productforums.google.com/forum/#!topic/docs/QzVhyW5bi-A
When you address the option like an object, then you should use a backslash: =SPARKLINE(C11:N11;{"charttype"\"bar"}

Resources