Error with ImportXML within GoogleSheet - google-sheets

To not use another thread and after trying to get my formula working with multiples examples from the Internet, I have built the following :
=importXML("http://www.sportingcharts.com/nhl/stats/player-blocks-statistics/2015/", "//*[#id="statomatic"]/table")
However, when running it with Sheets, it gives me a parse error.
What have I done wrong ?

Part 1: The parsing error
The parsing error occurs because the double quotes. Replace the inner double quotes by single quote. In other words, instead of
"//*[#id="statomatic"]/table"
something like the following should be used:
"//*[#id='statomatic']/table"
Part 2: The xPath
Once the parsing error be resolved the resulting formula still will not work because the xPath can't be found.
The following xPath will return the stats table in the page:
"//div/table/*/tr"
Note: the quotes are included as they are required by the IMPORTXML formula.

Related

Google Sheets Filter function returns: #ERROR - 'formula parse error'

I am using the filter function in a master sheet to grab data from 2 other sheets in google sheets. Both of these sheets go through row M.
When I run the filter functions individually, they both run.
=FILTER('Query Manual'!A2:M,'Query Manual'!A2:A<>"")
=FILTER('Query CSI'!A2:M,'Query CSI'!A2:A<>"")
But when I combine them I get a formula parse error with the #ERROR response.
=(FILTER('Query Manual'!A2:M,'Query Manual'!A2:A<>""), FILTER('Query CSI'!A2:M,'Query CSI'!A2:A<>""))
I'm not sure why I'm getting this error when I put the two together, but individually they each work fine?
={FILTER('Query Manual'!A2:M,'Query Manual'!A2:A<>""); FILTER('Query CSI'!A2:M,'Query CSI'!A2:A<>"")}
Curly Brackets instead of commas. I put on my reading glasses and realized this lol.

Formula Parse Error with double quotes in Regex expression

I'm trying to add a Regex expression to REGEXMATCH, but every time I try Google sheets adds a closing parenthesis and breaks the formula giving me a parse error. I'v tried to escape the single quote, double quote and parenthesis, but with no luck any tips? also tried to add the regex to a cell and reference that, but didn't behave as expected
this is the regex I'm trying to add ['"(]
you will need to double them like:
['""(]
example: https://stackoverflow.com/a/66028064/5632629

HTML concatenate functions producing strange outputs in Google Sheets

I am trying to build some concatenate functions to work with HTML.
The functions are almost there, but when I copy the result from Google Sheets the formula doesn't pick up the dynanic value from another cell:
=CONCATENATE("<div class=""audio-container"" style=""display:flex;justify-content:center;align-items:center;""><audio controls><source src="",B3,"" type=""audio/mpeg""></source></audio></div>")
FORMULA OUTPUT: <div class="audio-container" style="display:flex;justify-content:center;align-items:center;"><audio controls><source src=",B3," type="audio/mpeg"></source></audio></div>
ISSUE: The B6 CELL reference containg the string download.mp3 is not inserting
I think it is something to do with the HTML double quotes, even though they seem to output correctly, but the cell reference seems to be ignored and is being recognized as a string instead.
You were almost there. I got:
=CONCATENATE("<div class=""audio-container"" style=""display:flex;justify-content:center;align-items:center;""><audio controls><source src=""";B1;""" type=""audio/mpeg""></source></audio></div>")
The output I get is: <div class="audio-container" style="display:flex;justify-content:center;align-items:center;"><audio controls><source src="download.mp3" type="audio/mpeg"></source></audio></div>
You were right, the problem was in the double quotes. You had to add a third one. Look at the part ...src=""";B1;""" type=.... That fixed everything.

Why is this IMPORTRANGE formula not working?

I keep getting an error while using the IMPORTRANGE formula:
=importrange(“1uUbz2HAzgwBwY3zMXqcLJM_Z8qVQZHNP0wzRaNHceTc”, “Sheet1!A:B”)
I changed the name of my sheets several times to make sure everything matches but see a:
Formula parse error
and I am not sure what I am doing wrong. The original sheet has several tabs as well.
Can you see where the error is?
This worked for me:
=importrange(“1uUbz2HAzgwBwY3zMXqcLJM_Z8qVQZHNP0wzRaNHceTc”; “Sheet1!A:B”)
Maybe try it with a semicolon
Add the link format
eg
=importrange("https://docs.google.com/spreadsheets/d/1uUbz2HAzgwBwY3zMXqcLJM_Z8qVQZHNP0wzRaNHceTc","Sheet1!A:B") this should fix it
One other issue that can prevent import range from working is leading or trailing space in your sheet name. Make you check the sheet tab and clean out any leading or trailing spaces or your formula won't work. :-)
I burned an hour reading this thread and recreating my formula over and over again before I finally found the issue.
You have it as Sheet1!A:B, but you are missing the single quotes to identify the sheet name.
It should be 'Sheet1'!A:B instead.
The full formula is below:
=importrange(“1uUbz2HAzgwBwY3zMXqcLJM_Z8qVQZHNP0wzRaNHceTc”, “'Sheet1'!A:B”)
Make sure the sheet you're trying to import from is saved as a google sheet. I was trying to import an .xls file into a google sheet, and it wouldn't work. I re-saved the sheet as a google sheet and it fixed the problem immediately.
Problem
This formula does not work
=importrange(“1uUbz2HAzgwBwY3zMXqLJM_Z8qVQZHNP0aNHceTc”,“Sheet1!A:B”)
Reason why
You use curly double quotes “ ” instead of straight double quotes " "
SOLUTION
Change the quotes from curly to straight
=importrange("1uUbz2HAzgwBwY3zMXqLJM_Z8qVQZHNP0aNHceTc","Sheet1!A:B")
Be careful
If you have different locale you must also change , to ;

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