Hi I'm using the GOOGLEFINANCE command in google sheets to return stock prices which is working but when the market is closed it still returns a value (last trade price) - I only want to return a price when the market is open. (this could be USA market or London market etc. any supported ticker)
is there any way of checking if the stock market is open or closed in a google sheet?
thanks
There is a way with GOOGLEFINANCE, you can get the last date of trading, you can compare it to today, and with a IF statement you can decide to display the value or 0.
You may need to adapt the date comparison based on your language but here is the formula that worked for me
=IF(LEFT(GOOGLEFINANCE("AAPL";"tradetime");10) = TEXT(TODAY();"dd/mm/yyyy");GOOGLEFINANCE("AAPL";"change");0)