How to extract a text from a url while conditionally rendering the images using an Arrayformula in Google Sheets? - google-sheets-formula

This formula below does extract the file ID and yields the correct image url. Now, how to fetch the correct url to extract that ID from by verifying a key using VLOOKUP() maybe?
I've seen that REGEXEXTRACT() requires JOIN() and could this be the reason why it doesn't work?
Current formula doesn't populate the rows, but only the one it's sitting in:
=arrayformula(iferror(image("https://drive.google.com/uc?export=view&id="&regexextract(VLOOKUP($F$3:$F$100,$I:$I,2,0),"d/(.+)/view")),""))
Here's a file for tests, if you feel like operating.
Thank you!

Your formula is working! Just change $I:$I with $I:$J.
You need to put the whole range including the column to look at and the column with the results.

Related

How to filter multiple classes in XPath GoogleSheet ImportXML function to get the desire output

How can I filter the XPath by multiple class to get the data for each year in Table format?
Current code:
=IMPORTXML(CONCATENATE("https://www.google.com/finance/quote/",C2,":NASDAQ"),"//table//tr[contains(#class,'roXhBd')]")
C2 is a reference cell in excel which can be any ticker
Current output
Desired Output
I think GOOGLEFINANCE() formula in Google Sheets is better for this kind of extraction.
You can get many parameters for any ticker:
https://support.google.com/docs/answer/3093281?hl=en
You can import long datasets and parameters in intervals you want and play in your spreadsheet without importxml.
IMPORTXML returns only values that are visible on the website. In order to find a solution, you should find a way to manipulate URL to get you right date ranges. I can't see this option on the site you link.

Unable to convert the row into Colum in PDF doc using UniPDF

I am trying to convert the row of a PDF table in a column using UniPDF Go Library, I have tried the example they are mentioned at https://github.com/unidoc/unipdf-examples/blob/master/tables/pdf_tables_row_wrap.go but I am not able to modify the document as required.
Any help would be appreciated.
Not sure if I understand this correctly, but I am assuming you have input data that you want to display in a single column.
To achieve this, you can create a single-cell column:
https://github.com/unidoc/unipdf-examples/blob/fe269eb0efffed8e199c82cb7b7b4a38859b35d7/tables/pdf_tables_simple.go#L98
with
table := c.NewTable(1)
I have created a play for this: https://play.unidoc.io/p/3421387bcde00a52
see also
https://apidocs.unidoc.io/unipdf/v3.20.0/github.com/unidoc/unipdf/v3/creator/#Creator.NewTable

Empty filter results gives #VALUE! error

I've been working on this project where I need to consolidate data from two other sheets within the spreadsheet and filter the result for easy viewing. But I realized the problem when the filter gives no result there will be a #VALUE! error. The error isn't solved even when I have used IFERROR.
Link to the sample of the Google Spreadsheets.
There are two classes and I wish to filter out those who passed in the class and populate the table in the collated sheet.
You should be able to do something like this:
=query({Class1!A2:C; Class2!A2:C}, "where Col3 = 'pass'")
(change the sheet names and ranges to suit !).
(Also check the formula I entered in A1 of sheet 'JP')

Display data using FILTER formula not working

I have this Google Sheets.
In sheet named Archive I have imported some tweets. In Sheet1 I have the following formula:
=FILTER('Archive'!A2:A;MMULT(SEARCH(TRANSPOSE(" "&A2:A&" ");" "&'Archive'!A2:A&" ");SIGN(ROW('Archive'!A2:A))))
What I would like to do is to display specific tweets from sheet Archive, containing specific keywords listed on Sheet1. This formula should work, but not in this case when I am importing data. All I get is a #N/A.
Am I doing something wrong?
As discussed on the sheet chat window, use:
=FILTER('Archive'!A2:A;MMULT(SEARCH(TRANSPOSE(" "&A2:A&" ");" "&TRIM('Archive'!A2:A)&" ");SIGN(ROW(A2:A))))
In short, the second argument of MMULT needs to have as many rows as there are columns in the first argument. Here is a spreadsheet that tries to describe MMULT used in this sort of way.
The TRIM part is to mitigate against spurious space characters that may be in the raw data.

How do I return multiple columns of data using ImportXML in Google Spreadsheets?

I'm using ImportXML in a Google Spreadsheet to access the user_timeline method in the Twitter API. I'd like to extract the created_at and text fields from the response and create a two-column display of the results.
Currently I'm doing this by calling the API twice, with
=ImportXML("http://twitter.com/status/user_timeline/matthewsim.xml?count=200","/statuses/status/created_at")
in the cell at the top of one column, and
=ImportXML("http://twitter.com/status/user_timeline/matthewsim.xml?count=200","/statuses/status/text")
in another.
Is there a way for me to create this display with a single call?
ImportXML supports using the xpath | separator to include as many queries as you like.
=ImportXML("http://url"; "//#author | //#catalogid| //#publisherid")
However it does not expand the results into multiple columns. You get a single column of repeating triplets (or however many attributes you've selected) as shown below in column A.
The following is deprecated
2015.06.16: continue is not available in "the new Google Sheets" (see: The Google Documentation for continue).
However you don't need to use the automatically inserted CONTINUE() function to place your results.
=CONTINUE($A$2, (ROW()-ROW($A$2)+1)*$A$1-B$1, 1)
Placed in B2 that should cleanly fill down and right to give you sane column data.
ImportXML is in A2.
A3 and below are how the CONTINUE() functions are automatically filled in.
A1 is the number of attributes.
B1:D1 are the attribute index for their columns.
Another way to convert the rows of =CONTINUE() into columns is to use transpose():
=transpose(importxml("http://url","//a | //b | //c"))
Just concatenate your queries with "|"
=ImportXML("http://twitter.com/status/user_timeline/matthewsim.xml?count=200","/statuses/status/created_at | /statuses/status/text")
I posed this question to the Google Support Forum and this is was a solution that worked for me:
=ArrayFormula(QUERY(QUERY(IFERROR(IF({1,1,0},IF({1,0,0},INT((ROW(A:A)-1)/2),MOD(ROW(A:A)-1,2)),IMPORTXML("http://example.com","//td/a | //td/a/#href"))),"select min(Col3) where Col3 <> '' group by Col1 pivot Col2",0),"offset 1",0))
Replace the contents of IMPORTXML with your data and query and see if that works for you. I
Apparently, this attempts to invoke the IMPORTXML function only once. It's a solution for now, at least.
Here's the full thread.
This is the best solution (NOT MINE) posted in the comments below. To be honest, I'm not sure how it works. Perhaps #Pandora, the original poster, could provide an explanation.
=ArrayFormula(iferror(hlookup(1,{1;ARRAY},(row(A:A)+1)*2-transpose(sort(row(A1:A2)+0,1,0)))))
This is a very ugly solution and doesn't even explain how it works. At least I couldn't get it to work due to multiple errors, like i.e. to much parameters for IF (because an array is used). A shorter solution can be found here =ArrayFormula(iferror(hlookup(1,{1;ARRAY},(row(A:A)+1)*2-transpose(sort(row(A1:A2)+0,1,0))))) "ARRAY" can be replaced with IMPORTXML-Function. This function can be used for as much XPATHS one wants. – Pandora Mar 7 '19 at 15:51
In particular, it would be good to know how to modify the formula to accommodate more columns.

Resources