Index and import HTML not working in Google Sheets - html

I am trying to extract the certain value of a Single row of html table in 5th Row and third column from the below mentioned link
https://www.xe.com/currencytables/?from=USD&date=2020-02-07
the formula that I have used as mentioned below:
=index(IMPORTHTML("https://www.xe.com/currencytables/?from=USD&date=2020-02-07","table",0),5,3)
The formula doesnt extract the value in the cell instead it displays in the popup of google sheets.
I am looking to extract single value in 5th Row and third column . I tried using index and importxml but could not get any value.
Please help with the requiste formula to get the desired result .
Thanks

The formula seems to work fine for me.

Related

Can I show the results of COUNTIF in one column only if there is data in another column?

I have a spreadsheet with multiple sheets.
Sheet A is generated from a template, and it is where users will enter in data to be formatted into a report; it will be deleted after that report is submitted.
As people enter info into Column A of Sheet A, they don't have to enter client information if we already have them entered in this spreadsheet, but otherwise they need to go over to Sheet B and enter it in.
To make it easier for them (so they don't have to check every time, or go back and enter info later after getting an error generating the report), I have used conditional formatting. The way it works is, column Z is set up as a helper column, and uses a "COUNTIF" function to check if the client ID in Sheet A, Column A is found in Sheet B, Column C. Sheet A Column Z returns 0 or 1 (or, theoretically, more than one if we had duplicates), and then Sheet A column A has conditional formatting based on Column Z's value-- if the client is already in, the cell for client ID turns green after they type it; if not, it turns red.
It works great! However, I am adding scripts to these sheets, and looping through them. This helper column is filled from Z1 to Z1000, which means I can't use sheet.maxRow() to get the last row.
I see plenty of workarounds on the script side, but I was wondering if anyone has a clever way to input a value into the helper column Z ONLY IF the corresponding cell (same row) in column A has a value using spreadsheet formulas.
I suspect that an array formula with a filter might do it, but I have little experience with either and can't get anything to work out.
Thanks for your help!
You can use this expression with INDEX, MAX and ROW to make an ARRAYFORMULA only expandable until the last cell with value in column:
A2:INDEX(A2:A,MAX(ROW(A2:A)*(A2:A<>"")))
It will go from A2 to the maximum number of row in A in which A is different than null (that's why both conditions are multiplied).
Then you can set a formula like this in Z2 (check the ranges in case something is not right from reading your text, and delete all other formulas in Z too in case you weren't using an arrayformula already):
=BYROW(A2:INDEX(A2:A,MAX(ROW(A2:A)*(A2:A<>""))),LAMBDA(each,IF(each="","",COUNTIF('Sheet B'!C:C,each))))

Can't filter cell with query inside in Google Sheet

I have want to filter a column which i created by using the following formula:
=UNIQUE(Overall!A2:A614)
So basically it was to get unique value of data from a whole column from another sheet (overall)
Here is the column I want to filter (in black)
But When I filter it A-Z or Z-A, blank cells appear with 0 everywhere and some of the data are put at the bottom of the column:
Here is what I get when I filter
Do you have an idea about it how to be able to filter my column without that problem ? Thanks !
I was expecting that the filter would just work without such problem.

Google sheet auto populate row script

I am using a google sheet in which a new row is added by inserting Col A thru a third party app. Once Col A is added I wish to copy the formula from the remaining row cells above to auto calculate the values using the formulas in that row.
ArrayFormula doesn't help as I don't want to have the rows created in advance before Col A is populated.
Any script which can do this?
What you are looking for can be achieved with a formula. I have created a quick sheet to demonstrate this.
Cell B1 contains the following formula:
={"Formula";ifna(arrayformula(filter(A2:A, A2:A<>"")*5))}
This formula defines the header (meaning that it is placed in the first row, ultimately not affecting any third party data inputs), and then uses an array formula for the rest of the column. This formula works because of the filter. That filters out any cells that are not blank and multiplies them by 5. The IFNA portion ensures that if there is no data at all, the second row is still left completely blank. This was verified with a script I wrote to simulate a data entry.
function test() {
SpreadsheetApp.getActive().getActiveSheet().appendRow([Math.random()]);
}
This script is simple, and uses the appendRow() method to simulate what a third party entry would do. I used this script, and the result is displayed in the screenshot above. This shows that an appended row will still populate the next blank row, despite there being an array formula in cell B1. Using this logic, it is possible to change the formula to populate the actual data that you need.

How to get the value from another sheet with variable sheet name using Google Sheets?

I need to get the sheet name from a cell.
On image below I'm trying to get '4/2'!$AB60.
need to get the date which is 4/2 (cell D5)
combine it with !$AB60
now the cell D6 will have a formula value of '4/2'!$AB60
it will display the value.
Is there a way to formulate this instead of what I currently be doing, manually updating the each column dates (from C6 to AF6)? Is this even possible?
Formula from the screenshot: =JOIN(,LEFT(D5,LEN(D5),!$AB60)
The problem with this formula is !$AB60 as it is not a valid value, instead use "!$AB60" or use =TO_TEXT(D5)&"!$AB60". To use the result of this formula as a cell reference use INDIRECT, i.e.:
=INDIRECT(TO_TEXT(D5)&"!$AB60")

Setting array formula until last column in Google Sheets

I have a formula as follows in google sheets:
=ARRAYFORMULA(IF(LEN(F2:F),IFERROR(SPLIT(REPT("PAID ",F2:F)&REPT("- ",(24-F2:F))," ")),))
This formula will show paid according to number of paid in the cell and show "-" to the cells in the rest column. For now, this formula is only applicable for columns. I dont want like that, I want this formula to be used until the last column because the number of columns will be increased every year. I dont know whether this should be done in Google App Script or what. Anything should be fine to solve my problems. I have attached some images to explain myself clearly. Thanks in advance.
https://docs.google.com/spreadsheets/d/1bM8l6JefFsPrlJnTWf56wOhnuSjdIwg3hMbY1tN1Zp8/edit#gid=1775459006 - Link to google sheets
I will use the sheet "JALAN SANGGUL 4" as an example. Then you will need to apply to all of the other sheets that have the same structure.
Replace your current G1 formula with this:
=TRANSPOSE(FILTER(Configuration!P2:P,Configuration!P2:P<>""))
Replace your current G2 formula with this:
=ARRAYFORMULA(IF(LEN(F2:F),IFERROR(SPLIT(REPT("PAID ",F2:F)&REPT("- ",(COUNTA(FILTER(G1:1,G1:1<>""))-F2:F))," ",1,1)),))
The added FILTER in each constrains things to only areas where data exists. By counting where only data exists instead of using a set "24" in the second REPT clause, you'll always get dashes going only as far as there are months in Row 1.