+ Reply to Thread
Results 1 to 2 of 2

Creating a time series from data grouped in months for multiple years

  1. #1
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Creating a time series from data grouped in months for multiple years

    Hello Excel_lent community!

    I need to create a time series out of data that are grouped by month for many years. These are data for rainfall events. I am attaching an Excel file that will explain everything. The code that I have worked out thus far is also included but it is not doing what I want. Any help is appreciated !
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Creating a time series from data grouped in months for multiple years

    Private Sub CommandButton1_Click()
    Dim sim As Double, j As Double, m As Double
    Dim year As Double, column As Double
    Dim month As Double, row As Double, ss As Double
    sim = Cells(1, 1) ' count values
    m = 60 ' starting row from where the code outputs the value
    row = 1
    column = 2
    For year = 2038 To 2070 ' number of years
    For month = 1 To 12 ' number of months
    For i = 1 To sim

    If Cells(row, column) = year Then

    For j = 1 To 24
    Cells(m, 1) = Cells(row + 1, column) + ((j - 1) * 0.0104444444444)
    Cells(m, 2) = Cells(j + 2, column)

    m = m + 1
    Next j
    column = column + 1

    Else
    column = column + 1
    End If

    Next i

    row = row + 26
    sim = Cells(row, 1)
    column = 2

    Next month

    row = 1
    sim = Cells(row, 1)
    column = 2

    Next year

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding Series of Years, Months, & Days
    By jmaitri in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-10-2019, 03:41 AM
  2. How do I split daily time series data into seasonality grid by years
    By Oilking in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-20-2018, 04:40 AM
  3. [SOLVED] Age based on DOB; Accounts for leap years. Years old if >2, Months if <2 years old.
    By sharpmel in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-17-2013, 04:20 PM
  4. days, months and years between todays date and a series of dates
    By jonathanpalmer in forum Excel General
    Replies: 4
    Last Post: 09-22-2010, 03:04 AM
  5. How do I find the length of time (Years & Months) between 2 dates
    By David Picken in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 03-23-2006, 04:30 PM

Tags for this Thread

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