How to get daily percentage change of a stock(in array form) in google sheets?

227 Views Asked by At

How can I fetch daily % change of a stock in google sheet e.g for last 30 days or last 1 year in array form?

So far I got the daily close prices like this.

=GOOGLEFINANCE("NASDAQ:GOOGL", "close",DATE(2022,1,1),TODAY(),"DAILY")

Could someone please help?

1

There are 1 best solutions below

0
George On

Suggestion:

You can try this formula that calculates the daily change percentage based on the result from your formula above.

Formula:

=IFERROR(MAP(B1:B19,B2:B20, LAMBDA(old, new,((new-old)/old))),"--")

Result:

The sample below calculates the percent change for the past 30 days from today's date. You can adjust the date from your formula above based on how many days you want to show.

image

Notes:

  • The Percent format is set on column C

  • You can adjust the array parameter on the MAP formula (B1:B19 and B2:B20) if you intend to increase the number of days you want to show

Reference:

MAP function

Percent Change Formula