importxml phrase counter is not working with a set phrase - google-sheets

I am looking to build a phrase counter using importxml on google sheets. I have the initial formula complete and functioning most of the time, but there are a few issues.
Here is the formula:
=COUNTIF(SPLIT(REGEXREPLACE(lower(concatenate(IMPORTXML("https://www.hawkinsfamilylaw.co.uk/", "/html/body", "en_US"))), A39, SUBSTITUTE(A39, " ", "")), " "), SUBSTITUTE(A39, " ", ""))
With A39 being the phrase "divorce services".
As you can see from this page (https://hawkinsfamilylaw.co.uk/), 'divorce services' is mentioned once, but the formula is not registering this phrase.
Other phrases work, but for some reason the formula isn't finding this phrase.
Is this an issue with the importxml function, or is there a reason that this particular phrase isn't being found which is related to the structure of the formula?
Many thanks,
Sean

Related

How to integrate GOOGLEFINANCE results in an array formula?

Following ARRAYFORMULA is giving me an error "parameter 1 value is invalid."
=ARRAYFORMULA(IF(ISBLANK(B2:B), "", GOOGLEFINANCE(B2:B, "price")))
B column of my sheet contains the stock symbols whose value I wish to fill in my sheet. Example below
Company Name
GOOG
ADBE
MSFT
Can someone help here?
This questions seems to be a duplicate of Google finance as an argument for ArrayFormula. I have answered it with more detail. As a new user I'm only able to post an answer here, I cannot comment/flag as duplicate.
Anyway, assuming stock symbols are in range B2:B, then you put the following formula in cell C2:
=IFERROR(MAP(B2:B,LAMBDA(company,GOOGLEFINANCE(company,"price"))))
This is a new method since the introduction of LAMBDA and its helper functions in Google Sheets in August 2022.
The trick here is, as far as I understand, that MAP(LAMBDA) calculates the specified formula for each row in the input array separately (effect similar to manually expanding the formula over the whole range), whereas ARRAYFORMULA passes the whole array as an argument to the formula (GOOGLEFINANCE is special and doesn't work intuitively with such input).
LAMBDA and friends are available, so this works:
=BYROW(A2:A, LAMBDA(row, IF(row = "",, GOOGLEFINANCE(row, "price"))))
Old story:
GOOGLEFINANCE cannot be used in array formulas. You'll have to extend your formula downwards.
For example this formula should be in every cell from C2 and down:
=IF(NOT(ISBLANK($B$2:$B)), GOOGLEFINANCE($B$2:$B, "price"), "")

Importxml from Etsy site in Google Sheets

I want to extract the sale info from this link with importxml
link
My formula:
substitute(substitute(to_text(index(IMPORTXML(strong textLINK;"//div['before-sticky-nav']//div['trust-signals col-group content no-banner']//div['show-lg show-xl show-tv shop-info col-lg-7 pl-lg-3']//p['trust-signal-row text-gray-lighter']/span[3]");1));" Sales";"");" Sale";"")
The formula has been working for 1 month, yesterday it didn't work. I've tried many variations of the xpath still no luck.
Any ideas?
=VALUE(REGEXREPLACE(REGEXEXTRACT(QUERY({ARRAY_CONSTRAIN(IMPORTDATA(
"https://www.etsy.com/shop/1000Lightyear"), 4000, 1)},
"WHERE Col1 CONTAINS 'mr-xs-2 pr-xs-2 br-xs-1"">'"),
"\>([0-9 A-Za-z]+)\<"),
" Sales| Sale", ""))

Error when using match and indirect in Google Sheet

I have to make a conditional formating formula with cross-sheet references.
Basically I have many sheets, one with existing words, and another one with words we have to add. I want to highlight in "Feuille 6" the words that are already in "Existant". I tried many formulas, I read the doc, I still can't figure it out.
Quick edit : equiv = match, and ligne = row, it's just google sheet translating words into French..
Here's the formula I think I should use, but it's not working
=EQUIV(A,indirect("Sheet1!A"&LIGNE()))
Here's what the Feuille 6 looks like
Again, there should be highlighted words in Feuille 6, like " Action ", which already exists in the sheet " Existant ".
I tried replacing "Sheet1 "with "Existant" too.
Any tip please?
Thanks !
Try:
Assuming the sheet Existant has values in columns A to Z , and you are highlighting cells in column A
=countif(indirect("Existant!A:Z"), A1)

Concatenating Text

I need to concatenate text from various cells to a single cell in a row. This can go to an infinite number of rows.
How to use the CONCATENATE function in Google Sheets for doing this?
I also need to know how to use "if else if" in Google Sheets. For example:
IF(A2="This")
JOIN(" ", A2,B2)
ELSE IF(A2="I")
JOIN(" ",A2,C2)
ELSE IF(A2="value")
JOIN(" ",A2,D2)
Is this possible in Google Sheets?
Simply use jon function:
=join(" ", a2:e2)
You may also like this arrayFormula solution:
Google sheet arrayformula join() and split() functions
to merge text:
=CONCATENATE(A1;" ";B1;" ";C1;" ";D1;" ";E1)
And yes you can use CONCATENATE in IF formula.
Try something like this
if(A2="This",JOIN(" ", A2,B2),IF(A2="I",JOIN(" ",A2,C2),IF(A2="value"),JOIN(" ",A2,D2),"Else Value")))
Syntax
IF(logical_expression, value_if_true, value_if_false)
you can refer these links
https://productforums.google.com/forum/#!topic/docs/CmebALbskuo
https://support.google.com/docs/answer/3093364?hl=en

What's wrong with this Google Spreadsheets QUERY?

I've been struggling with this Spreadsheets query problem for hours and even after rigorous googling, couldn't figure out what's wrong or how to do this properly. Here's an example of the problem:
=QUERY('Sheet2'!2:3, "select B where A="A2"")
Example Spreadsheet: https://docs.google.com/spreadsheets/d/172kaXIs0-OhWxhvI65OvnfM1jiLt6OdQVrGYDjxf6V8/edit?usp=sharing
What I'm trying to do is pull data from the Sheet2 so that I can also include the A2 cell from Sheet1 in the equation for better automation. I know there's a way to do it but I just can't seem to be able to make it work.
The syntax is two pairs of quotes (each a single and a double) around concatenation with &. Please try:
=QUERY(Sheet2!2:3, "select B where A='"&A2&"' ")
Your version should work if the actual content of A2 were A2.

Resources