Google Sheets' IMPORTRANGE rows that only contain content - filter

In Google Sheets, how to IMPORTRANGE rows that only contain content from another spreadsheet
like:
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1cNtce7pkPlCF6YzpRoDeucSZq9iaiw6K8hILfQ3WHog/","Sheet1")

it could be like this:
=QUERY(IMPORTRANGE("1cNtce7pkPlCF6YzpRoDeucSZq9iaiw6K8hILfQ3WHog", "Sheet1!A:D"),
"where Col1 is not null", 0)
which translates as: import range A:D from another spreadsheet from tab called Sheet1 but only if column A is not empty

Related

Filter Range Based on Data Validation Dropdown

I have a Google Sheet that has a cell that I want to use as a drop-down filter for another range within the sheet.
You can take a look at the sheet HERE.
Cell G11 is the cell that I wish to have the drop-down filter in.
Range B15:H69 is the range that should be filtered upon using this filter.
So, for example - if I select 'Barbarian' in the G11 drop-down the sheet should go from something like this (cut short for size of post sake):
To something like this:
I've tried using Named Ranges, using a seperate sheet to filter the data, and a couple other methods I found. Nothing seems to work exactly how I want it to, like in picture #2.
try:
=INDEX(LAMBDA(x, SPLIT(FLATTEN(SPLIT(FLATTEN(QUERY(TRANSPOSE(x),,9^9))&"×​", "×")), " "))
(QUERY({ROW(Data!A2:D), SORT(Data!A2:D, 3, 0)},
"select Col1,Col2,'♀',Col3,Col4,'♂',Col5 where Col3 = '"&G11&"' label'♀''','♂'''")))
UPDATE:
=INDEX(LAMBDA(x, SPLIT(FLATTEN(SPLIT(FLATTEN(QUERY(TRANSPOSE(x),,9^9))&"×​", "×")), " "))
(QUERY({ROW(Data!A2:D)-1, SORT(Data!A2:D, 3, 0)},
"select Col1,Col2,'♀',Col3,Col4,'♂',Col5 where 2=2 "&IF(
REGEXMATCH(G11, "(?i)all|n\/a|^$"),," and Col3 = '"&G11&"'")&" label'♀''','♂'''")))

Google Sheets: display all values existing in column A when a specific string exist elsewhere on that row

I want to display all values existing in column A when a specific string exist elsewhere on that row.
The formula in B10 should display "Table, Bed" in any form.
=ARRAYFORMULA(JOIN(",",IF(C3:E5=A10,A3:A5,)))
Comparison = within a array formula produces the desired array. Join them with ,

xpath for getting table rows with missing cell images

I'm trying to use Xpath to grab in rows of a table containing images and text. Things work fine as long as images are present as on this 3rd table on this page. But when images are missing as in the table as on this page it doesn't work. I need to connect the image with the right row of table data.
Here's the type of xpath_query strings I've been using in google sheets, where A1 contains the url.
=importXML(A1,"//tbody//img/#src")
=importXML(A1,"//tbody//tr")
Thanks for any help.
Shorter alternative with XPath filtering (url in C2, formula in I27) :
=ARRAYFORMULA({{"figura:";IMAGE("https://www.patentati.it/"&IMPORTXML(C2;"//tr//img/#src|//tr[not(.//img)]/td[#class='domanda']"))}\QUERY(IMPORTHTML(C2;"table";1);"select Col2,Col3")})
Output :
Sidenote : I'm based in Europe. Formula for US locales :
=ARRAYFORMULA({{"figura:";IMAGE("https://www.patentati.it/"&IMPORTXML(C2,"//tr//img/#src|//tr[not(.//img)]/td[#class='domanda']"))},QUERY(IMPORTHTML(C2,"table",1),"select Col2,Col3")})
like this:
=ARRAYFORMULA(IMAGE("https://www.patentati.it"&TRIM(SUBSTITUTE(FLATTEN(
SPLIT(QUERY(IFNA(REGEXEXTRACT(QUERY(ARRAY_CONSTRAIN(IMPORTDATA(A1), 500, 1),
"where Col1 matches '.*zoomImage.*|.*rowspan.*'"),
"src=""(.+png)"), "♀♫"),,9^9), "♫")), "♀", ))))
and a whole table:
=ARRAYFORMULA({{"figura"; IMAGE("https://www.patentati.it"&TRIM(SUBSTITUTE(FLATTEN(
SPLIT(QUERY(IFNA(REGEXEXTRACT(QUERY(ARRAY_CONSTRAIN(IMPORTDATA(A1), 500, 1),
"where Col1 matches '.*zoomImage.*|.*rowspan.*'"),
"src=""(.+png)"), "♀♫"),,9^9), "♫")), "♀", )))},
QUERY(IMPORTHTML(A1, "table", 1), "select Col2,Col3", 0)})

Access word documents header containing a table with vbscript

I need to read the pure text values from cells of a table located in the page header of a word document using vbscript.
All i could achieve until now is to read some kind of text from the header by this:
wscript.echo WordApp.ActiveDocument.Sections(1).Headers(1).Range.FormattedText.Text
But how can i gain access to the table object and read each cell value?
Tables in Word documents can be enumerated via the Tables collection.
For Each tbl In WordApp.ActiveDocument.Sections(1).Headers(1).Range.Tables
For i = 1 To tbl.Rows.Count
For j = 1 To tbl.Columns.Count
WScript.Echo tbl.Cell(i, j).Value
Next
Next
Next

Using XPATH to select the row *after* a row containing certain text

I can't work out if this is possible or not, I've got a basic table but that table has a varying number of rows and data within it.
Assuming the table is just one column wide and a random number of rows long to select a row containing the text "COW" I can do something very simple like do: -
table/tbody/tr[contains(td[1],"COW")]/td[1]
But lets say that this table contains two types of data in it, a list of animals and, underneath each animal, a list of attributes, all in the same column, looking something like this: -
COW
Horns = 2
Hooves = 4
Tail = 1
CHICKEN
Horns = 0
Hooves = 0
Tail = 1
Is there a way using XPATH to first identify the row that contains the text COW and then select the row directly after this to return the text "Horns = 2"?
Cheers
It seems that you want something like this:
table/tbody/tr[contains(td[1],"COW")]/following-sibling::tr[1]/td[1]
This will select the first td in the row immediately following the row which contains the td which contains COW.

Resources