MSFT 365 Price Change For X Number Of Days

Data123

Board Regular
Joined
Feb 15, 2024
Messages
68
Office Version
  1. 365
Platform
  1. Windows
I recently purchased MSFT 365 for access to Excel for stock data and was super impressed with the program and data! Then I tried to create a column header for, "Price % Change X Days" and realized STOCKHISTORY counts weekends and holidays as data days. I read about the WORKDAY solution, but this would not solve the holiday issue. Is there a way to create a formula based on days with data only OR X number of days with data?

Lastly, does one have to create a formula that shows a table with dates and prices or can a formula just show the percentage result for each symbol?
 
I could be wrong, but I think workday is a better option. If I don't worry about holidays right now. Can you edit this formula for (Price Change % 5 days) please;

=LET(sh,STOCKHISTORY(A2,WORKDAY(TODAY(),-7-1,1,TAKE(sh,-1)/TAKE(sh,1)-1)

Mr Excel has a link where he describes this very issue of weekends. His formula has a today()-7-1,1 to combat this issue. Excel STOCKHISTORY Never Falls On Weekend Or Holiday - 2468

You know much more than I, can his formula shown in that video at 3.19 min. be implemented in the =LET(sh,.....formula?
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I could be wrong, but I think workday is a better option. If I don't worry about holidays right now. Can you edit this formula for (Price Change % 5 days) please;

=LET(sh,STOCKHISTORY(A2,WORKDAY(TODAY(),-7-1,1,TAKE(sh,-1)/TAKE(sh,1)-1)

Mr Excel has a link where he describes this very issue of weekends. His formula has a today()-7-1,1 to combat this issue. Excel STOCKHISTORY Never Falls On Weekend Or Holiday - 2468

You know much more than I, can his formula shown in that video at 3.19 min. be implemented in the =LET(sh,.....formula?
 

Attachments

  • Capturee2.JPG
    Capturee2.JPG
    70.5 KB · Views: 4
Upvote 0
No worries that last post I did completed it. Thanks!!!
 
Upvote 0
So, you're good? You may want to post your final formula, and mark it as a solution, so people can find it when searching.
(don't mark mine as the solution, unless it really gave you your answer - I don't think I did.). I just saw you marked it. Mark yours if it is correct.
 
Upvote 0

Forum statistics

Threads
1,215,072
Messages
6,122,968
Members
449,095
Latest member
Mr Hughes

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