STOCKHISTORY Help Needed

marshak

Board Regular
Joined
May 28, 2007
Messages
65
Hello all!

I need help...and fast. I am using STOCKHISTORY for the first time. My client needs the formula to show all the dates in the range (including the weekend and the holidays). On the weekends and holidays, we need the result to be a dash. How can I accomplish this? Please help!

The current formula in Column R is:
=STOCKHISTORY(H7,L56,TODAY(),)

However, I would like to get all of the dates shown in column Q.

Thanks in advance for your help.

K
 

Attachments

  • Capture.PNG
    Capture.PNG
    24.3 KB · Views: 7

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Examine this Article here in MrExcel to see if it helps.

I know you want a dash for non-trade days, but I suggest using the last price. That way, you can use the data in calculations over various time periods. For example, what was the price 7 years ago? If that 7-year-ago data happens to be a non-trade day, well then you can at least avoid an error.
 
Upvote 0
Thanks a bunch for your response. I did see that explanation and have been trying to use it, but I am still not understanding. Please help!
 
Upvote 0
Okay, the problem is that we want to fill in the the array of data with dates that STOCKHISTORY lacks, like weekends and holidays. So we use XLOOKUP to report the last existing price. That way we can fill in all the dates from START DATE to today as well as assign prices to the days not reported by STOCKHISTORY.

The INDEX is needed because STOCKHISTORY is a dynamic array function that reports more than one column if we ask for DATE and CLOSE (or more columns).

Try to download that sample worksheet and see if you can see what the deal is.
 
Upvote 0
Solution
Thanks so much! My client actually wants the weekend and holidays to just show a dash (instead of a price) -- is that possible?
 
Upvote 0
The Excel example helped a lot -- thank you!! Now I need the nontrading days to display a dash (–). How can I do that? Any assistance is greatly appreciated!!
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,467
Members
448,965
Latest member
grijken

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