+ Reply to Thread
Results 1 to 3 of 3

How to repeat a pattern?

Hybrid View

creekums How to repeat a pattern? 08-08-2008, 01:36 PM
Richard Buttrey Hi, and welcome to the forum.... 08-08-2008, 04:04 PM
creekums Thanks 08-12-2008, 12:21 AM
  1. #1
    Registered User
    Join Date
    08-08-2008
    Location
    San Diego
    Posts
    2

    How to repeat a pattern?

    I have data taken every 60 minutes every day for three years with six hours a day. I have my data in a column, let's say G. In column H I have:
    H2 =G2-G$1
    H3 =G3-G$1
    H4 =G4-G$1
    H5 =G5-G$1
    H6 =G6-G$1
    H7 =G7-G$1
    H8 =G8-G$7
    H9 =G9-G$7
    H10 =G10-G$7
    Column H is every hour's data minus the closing price of the day before, which is every sixth cell or cells 1, 7, 13, 19, ....6n-1.
    I have 40,000 cells (I have SP500 every 10, 30, and 60 min) and I was wondering if there was a way to repeat this pattern or if I have to do it all manually.

    Thanks a bunch.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi, and welcome to the forum.

    Assuming data starts in row 1, in H2 try:

    =G2-INDIRECT("G$"&INT((ROW()-2)/6)*6+1)
    and copy it down.

    HTH

  3. #3
    Registered User
    Join Date
    08-08-2008
    Location
    San Diego
    Posts
    2

    Thanks

    Thanks for your suggestion. I really appreciate that. Luckily, I got help writing a module in VB.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1