STOCKHISTORY showing price change 30 days back for 20 stocks

AllanSE

New Member
Joined
May 5, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi all

I'm new here since I currently use Google Sheets to track my portfolio but Google Finance is getting increasingly unreliable, so I would like to migrate to Excel and O365. I already have O365 subscription.

I would like to see the following.
In my example sheet, I have:
Column A stocks names
Column B should show price change 30 days back in % but it fails (formula: =STOCKHISTORY(A2;TODAY()TODAY()-30;0;1;1)
Columns C:H some stats, it works but I simply can't get it to continue downwards

Can you see where I do mistakes? Hope I have followed all the forum rules. Here is an editable link to where I try out the different functions. Sheet is called MrExcel.

Thanks in advance.
Allan, Sweden
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You have your start and end dates the wrong way around, try as below:
Excel Formula:
=STOCKHISTORY(A2;TODAY()-30;TODAY();0;1;1)
 
Upvote 1
I have edited that file, when using the STCKHISTORY function in that way it is best to turn off the headers part in the formula. See if the edits made help?
 
Upvote 0
Hi Georg!
I see you heavily are working on the sheet! Big thanks for your help, time and support. If I don't answer it's because I need to take my daughter to the doctor but hope to be back soon.

Thanks.
Allan, Sweden
 
Upvote 0
I have come out of the file now, worth noting that the TODAY()-30 does not always return the amount of results expected, i noted some stocks returned 18 results and others 21+, might be somthing to investigate (unless it excludes weekends and bank holidays)

Below is how it ended up:
STOCKHISTORY.xlsx
ABCDEFGH
2Swedbank AB (OTCM:SWDBY)-2.40%01/06/20222,899,852$ 15.24$ 15.90$ 12.50$ 12.63
3Tele2 AB (XSTO:TEL2 B)-1.60%01/06/202248,726,837120.40 kr122.10 kr111.70 kr116.50 kr
4Thule Group AB (XSTO:THULE)-10.77%01/06/20228,147,107329.10 kr330.50 kr245.10 kr251.30 kr
5Volvo AB (XSTO:VOLV A)-4.69%01/06/20222,678,957183.40 kr190.20 kr162.10 kr164.60 kr
63M COMPANY (XNYS:MMM)0.44%01/06/202263,798,266$ 149.33$ 149.49$ 127.30$ 129.41
7ABBVIE INC. (XNYS:ABBV)8.36%01/06/2022132,594,299$ 147.79$ 156.62$ 135.76$ 153.16
8Acea SpA (XMIL:ACE)-4.40%01/06/20223,449,877€ 16.90€ 17.18€ 13.43€ 14.11
9Acadian Timber Corp. (XTSE:ADN)-3.30%01/06/2022178,205$ 18.33$ 18.55$ 16.01$ 16.66
10Acerinox SA (BMEX:ACX)-4.95%01/06/202236,431,467€ 12.16€ 12.41€ 9.15€ 9.24
11AGNC INVESTMENT CORP. (XNAS:AGNC)10.28%01/06/2022284,248,593$ 12.25$ 12.41$ 9.99$ 11.07
12ALARIS EQUITY PARTNERS INCOME TRUST (XTSE:AD.DB.A) 01/06/20221,114,000$ 99.00$ 99.00$ 93.00$ 96.85
MrExcel
Cell Formulas
RangeFormula
B2:B12B2=IFERROR(LET(s,STOCKHISTORY(A2,TODAY()-30,TODAY()-1,0,0,1),st,TAKE(s,1),en,TAKE(s,-1),(st-en)/st),"")
C2:H12C2=STOCKHISTORY(A2,EOMONTH(TODAY(),-11),,2,0,0,5,2,3,4,1)
Dynamic array formulas.
 
Upvote 1
Solution
Hello again Georg

So many thanks - this and your support will be a big step for me to migrate to Excel. I'll of course keep the file shared if anyone else could benefit from the solution.

Thanks again - wish you a great weekend.
Allan, Sweden
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top