I am using Google Spreadsheet function.
This formula works fine.
=ImportXML("https://www.google.com/finance?q=SHA:000001", "//span[#class='pr']")
The string SHA:000001 is contained in cell B4. I would like to use cell reference. So, I changed to formula to
=ImportXML("https://www.google.com/finance?q=" + B4, "//span[#class='pr']")
Unfortunately, this did not work. The value returned is #VALUE!. How should the correct formula look like?
You need to use an ampersand not a plus sign:-
=ImportXML("https://www.google.com/finance?q="&B4, "//span[#class='pr']")
Related
I have two google sheets: sheet1 and sheet2. In sheet1 I have in cell A1 this the text "sheet2!b2". How do I reference A1 in cell A2 to be able to pull the ACTUAL data from sheet2!b2? When I try to use in a formula, i just get the sheet2!b2 text... it does not pull the value from sheet2. Any help would be appreciated. Thank you
As #RemcoE33 said in your comment, you can use the Indirect formula, it takes a string in the formula, so you can reference it as:
Indirect(A1) (as seen in the image below, or
Indirect("Sheet2!B2")
(the value of my sheet2!b2 is Hello, so you can see it works. For more information you have the documentation of Indirect
I have this situation on Google Sheets:
I want to concatenate (=A2&B2) with a merged cell, but only the first cell has a value. I want to get the values of the column "Expected results". How I can detect the first value of each work office in this example?
You can use INDEX/AGGREGATE:
=INDEX($A$1:$A$9,AGGREGATE(14,4,(ISBLANK($A$1:$A$9)=FALSE)*(ROW($A$1:$A$9)<=ROW())*ROW($A$1:$A$9),1)) & B2
Edit for google sheets:
=INDEX($A$1:$A$9,LARGE((ISBLANK($A$1:$A$9)=FALSE)*(ROW($A$1:$A$9)<=ROW())*ROW($A$1:$A$9),1)) & B2
When merging a cell, the content appears only as if it were if the first cell of that block. Hence, you need to only use that first value as your reference. For this you need to block the reference, and it would look like this:
=($A$1&B2)
You can check more information about that in this link.
Try this in D2:
=ARRAYFORMULA(IF(B2:B="",,VLOOKUP(ROW(A2:A),FILTER({ROW(A2:A),A2:A},A2:A<>""),2)&B2:B))
im trying to mark matching URLs red.
I have two sheets with URL Data.
My custom Formula looks like this:
match(A2,indirect(Sheet2!A2:A),0)
wondering why there is an error if i use =match(A2,indirect(LostURLs!A2:A),0)
so with the additional =
Anyways both methods are not working and im wondering why?
Indirect excepts the first argument to be "a cell reference as string".
So please try
=match(A2,indirect("LostURLs!A2:A"),0)
and see if that works?
Note: depending on if you want the formatting for a single cell, a column or a row you may have to use a dollar sign in the first argument of the match() function
E.g: If you'd want to repeat the formatting for column A, you would have to use
=match($A2,indirect("LostURLs!A2:A"),0)
For row 2 that would be:
=match(A$2,indirect("LostURLs!A2:A"),0)
and for a single cell
=match($A$2,indirect("LostURLs!A2:A"),0)
NOTE: Depending on your locale, you may have to change the comma's to semi-colons.
perhaps try:
=MATCH(A2; INDIRECT("LostURLs!A2:A"); 0)
I've got a google sheet with duplicate cell values. I was wondering if there's a quick and easy way to replace all those duplicates with a reference to just one of them, i.e "=[cell]".
yes, this is possible to do with formula.
Paste this in B2 and copy the formula down:
=if(countif($A$2:A2,A2)>1,"["&ADDRESS(MATCH(A2,A:A,0),COLUMN(A2),4)&"]",A2)
Then to get actual cell refference, use script:
this formula makes text looking like reference: =if(countif($A$2:A2,A2)>1,"="&ADDRESS(MATCH(A2,A:A,0),COLUMN(A2),4),A2)
script must getValues and then setFormulas to range B2:B
Is it possible to use a cell to define the end of a range for a formula?
Essentially, I would like to use the JOIN() statement to concatenate a section of a column of data.
The data starts at a cell, say A5, and runs to a cell with the word 'total' in it. I've created a cell (let's call it L12) which returns the number of rows of data that are available.
I'd like to use that cell to form part of the range details of the JOIN() formula thus:
=JOIN(" ", A5: A[the value in L12]).
Is this possible?
I've found the indirect() function does exactly what I needed it to do.
See the Google function list https://support.google.com/docs/bin/static.py?hl=en&topic=25273&page=table.cs