hcs1210

New Member
Joined
Dec 24, 2017
Messages
3
Hi friends,

New here and really hope someone can help. This is for a work challenge so is super important to me. I have never created a macro in excel, though I'm almost positive this is the only way to get excel to perform the task.

In my workbook I have price data for a stock by day (I am using end of day closing price).

Columns are: Date, Close Price of Stock for given date, % Change (to determine whether day gave positive or negative return)

The first task - Finding the number of times the stock has had 7 consecutive days of positive returns. I used a frequency function (and help from a previous thread in this community) to find that this has happened 14 times since 2010. (I believe my formula is correct by only 80% sure)

Current task - Now I need excel to spit back to me the dates where this has occurred. The idea would be to have a list of the dates in a column in the workbook. I only need the date of the 7th day of consecutive positive return.

What is the easiest formula or macro to get the dates?

Below is a snipit from my workbook for reference.

THANK YOU ALL SO MUCH and Happy Holidays!
H

Frequency formula used to provide 14: =SUM(IF(FREQUENCY(IF(H3:H2010>0,ROW(H3:H2010)),IF(H3:H2010<0,ROW(H3:H2010)))>=7,1))

Date Close % ChangeConditionsCountDates where condition is true
1/4/10 $1,886.707 consecutive values > 014
1/5/10 $1,888.439.16%
1/6/10 $1,878.42-53.29%
1/7/10 $1,876.72-9.06%
1/8/10 $1,892.5983.85%
1/11/10 $1,886.24-33.66%
1/12/10 $1,861.79-131.32%
1/13/10 $1,886.13129.05%
1/14/10 $1,886.522.07%
1/15/10 $1,864.52-117.99%
1/19/10 $1,895.48163.34%
1/20/10 $1,867.95-147.38%
1/21/10 $1,850.57-93.92%
1/22/10 $1,794.82-310.62%
1/25/10 $1,802.3942.00%
1/26/10 $1,803.868.15%
1/27/10 $1,818.9082.69%
1/28/10 $1,771.10-269.89%
1/29/10 $1,741.04-172.66%
2/1/10 $1,760.72111.77%
2/2/10 $1,776.9291.17%
2/3/10 $1,784.7043.59%
2/4/10 $1,732.99-298.39%
2/5/10 $1,746.1275.20%
2/8/10 $1,734.88-64.79%
2/9/10 $1,753.84108.11%
2/10/10 $1,749.76-23.32%
2/11/10 $1,775.74146.31%
2/12/10 $1,779.1118.94%
2/16/10 $1,802.06127.35%
2/17/10 $1,810.8648.60%
2/18/10 $1,823.3968.72%

<colgroup><col><col><col span="2"><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Ok...well I'm going to give you your first programming lesson.

Get familiar with google and how to effectively use searches to help get answers you need. Its a programmers best friend.

Almost seems like you're addressing me, but you're probably advising OP.
 
Upvote 0
Its a challenge so the idea is for you to be challenged, not have someone give you the answer.

I'm definitely not looking for someone to give me the answer. I'm just really struggling with this and need some help. I thought that's what this forum was for.

I've been googling and going at this for awhile to no avail. I cannot figure it out. It's not my world. Why would I not reach out to a resource for help?

I am really trying to learn this stuff and just sitting here not knowing the answer is not getting me anywhere either.

I would really appreciate any help anyone can offer.
 
Upvote 0
I wish - sadly I'm no longer in school. I just really want to learn excel (it's always been an insecurity of mine) so I'm working through some problem sets. Stuck here.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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