'How do I get market cap of a stock of 6 months ago using google sheet
I am trying to get market cap of a stock of six months ago using google sheet
The implementation below shows market cap of a stock at present time.
=GOOGLEFINANCE(ticker, "marketcap")
How do I get market cap of a stock that was 6 months ago? thanks!
Solution 1:[1]
Marketcap is an attribute of real-time data
The syntax for GOOGLEFINANCE is :
GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])
ticker - The ticker symbol for the security to consider. It’s mandatory to use both the exchange symbol and ticker symbol for accurate results and to avoid discrepancies. For example, use “NASDAQ:GOOG” instead of “GOOG.”
attribute - [ OPTIONAL - "price" by default ] - The attribute to fetch about ticker from Google Finance and is required if a date is specified.
attribute is one of the following for historical data:
"open" - The opening price for the specified date(s).
"close" - The closing price for the specified date(s).
"high" - The high price for the specified date(s).
"low" - The low price for the specified date(s).
"volume" - The volume for the specified date(s).
"all" - All of the above.
attribute is one of the following for real-time data:
"price" - Real-time price quote, delayed by up to 20 minutes.
"priceopen" - The price as of market open.
"high" - The current day's high price.
"low" - The current day's low price.
"volume" - The current day's trading volume.
"marketcap" - The market capitalization of the stock.
"tradetime" - The time of the last trade.
"datadelay" - How far delayed the real-time data is.
"volumeavg" - The average daily trading volume.
"pe" - The price/earnings ratio.
"eps" - The earnings per share.
"high52" - The 52-week high price.
"low52" - The 52-week low price.
"change" - The price change since the previous trading day's close.
"beta" - The beta value.
"changepct" - The percentage change in price since the previous trading day's close.
"closeyest" - The previous day's closing price.
"shares" - The number of outstanding shares.
"currency" - The currency in which the security is priced. Currencies don't have trading windows, so open, low, high, and volume won't return for this argument
start_date - [ OPTIONAL ] - The start date when fetching historical data.
If start_date is specified but end_date|num_days is not, only the single day's data is returned.
end_date|num_days - [ OPTIONAL ] - The end date when fetching historical data, or the number of days from start_date for which to return data.
interval - [ OPTIONAL ] - The frequency of returned data; either "DAILY" or "WEEKLY".
interval can alternatively be specified as 1 or 7. Other numeric values are disallowed.
Solution 2:[2]
The Google Finance function in Google Sheets doesn't actually return historical market cap info like this. You can only get the current market cap for a company.
The wording in the documentation makes it confusing. It had me googling for an answer for some time.
Here is a related thread that highlights the language in the documentation and made it clearer to me.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | kplus |
| Solution 2 | codesnerd |
