google-sheetsgoogle-financegoogle-finance-api

Google Sheet, Finance: FILTER twice to get only one cell


I have a Google Sheet with some stock information.

I'm using the formula GOOGLEFINANCE($B2, "price",TODAY()-15) to retrieve historical information about a stock (symbol named in $B2).

That returns a 2x2 table:

Date                 Close
8/25/2017 17:36:00   7.46

I only want the 7.46:

Using =FILTER(GOOGLEFINANCE($B2, "price",TODAY()-15),{FALSE; TRUE}) I get:

8/25/2017 17:36:00   7.46

I can't see to be able to nest FILTER twice.

I checked the documentation. Other than say that I should not use FILTER to filter columns and rows in the same call, I didn't get much out of it.


Solution

  • For 2 filters try:

    =FILTER(FILTER(GOOGLEFINANCE($B2, "price",TODAY()-15),{false;true}),{false,true})

    I prefer query in this case:

    =QUERY(GOOGLEFINANCE($B2, "price",TODAY()-15),"select Col2 label Col2 ''")

    Also please try this formulas separately:

    ={false;true}

    ={false,true}

    and see the result.