+ Reply to Thread
Results 1 to 5 of 5

Macro to convert occupancy time series data for bird houses into matrix of 1's and 0's

  1. #1
    Registered User
    Join Date
    09-19-2020
    Location
    Baltimore, MD
    MS-Off Ver
    Microsoft 365
    Posts
    2

    Macro to convert occupancy time series data for bird houses into matrix of 1's and 0's

    Hello all,


    I have what I suspect is a fairly simple task. Apologies for my ignorance, I'm new to VBA. I've got some time series data on bird house occupancy I got from another birder for a set of bird houses collected at month-level resolution. The attached excel sheet is an example of the data I have (The actual data is hundreds of rows, there are a lot of bird houses, so any solution needs to be able to handle that. The attached is just an example). What I would like to do is create a macro that will take the data in the form I have it in (indicated on the attached sheet by "*Form of data I have") and use it to populate a matrix where the columns are months and the rows are bird houses (such as shown on the sheet as "Blank Matrix"). An example of the desired output for the data is shown in the filled-in matrix ("Desired Matrix"). Months in which a bird house is occupied should be denoted by 1's, months when it is not left as 0's. Note that in the columns of data as I have them all of the months between when a bird house is first occupied and when it is abandoned should also be filled in by 1's.

    Thank you for any suggestions, I've been trying to teach myself how to do this for two days and I suspect it will be short order for some of you all.

    Take care.

    -Andy
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Macro to convert occupancy time series data for bird houses into matrix of 1's and 0's

    As VBA that should be Quite Easy.

    I can't think of a neat formula based solution.


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 09-19-2020 at 09:34 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,208

    Re: Macro to convert occupancy time series data for bird houses into matrix of 1's and 0's

    Hi Andy

    Welcome to the Forum...My take on this one...

    As your Month abbreviation was inconsistent... i.e "mmm" and "mmmm", I corrected this which allows for my code to work...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 09-20-2020 at 07:37 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Registered User
    Join Date
    09-19-2020
    Location
    Baltimore, MD
    MS-Off Ver
    Microsoft 365
    Posts
    2

    Re: Macro to convert occupancy time series data for bird houses into matrix of 1's and 0's

    Thank you to you both! Reputation buttons clicked.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,208

    Re: Macro to convert occupancy time series data for bird houses into matrix of 1's and 0's

    .........................
    THANKS.gif

+ 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. Convert Time Series OHLC Data Frequency
    By prudential in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-19-2020, 11:50 PM
  2. [SOLVED] Macro to convert and Transpose a Matrix of 16 Columns and 16 Rows
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-10-2017, 08:19 PM
  3. Convert Time to Decimal with Custom Time Matrix
    By john.fries in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-14-2016, 11:19 AM
  4. Hi, I have hourly time series data and i need to convert it to 15 min time slots
    By neerajsharma887 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-15-2014, 01:08 PM
  5. Replies: 6
    Last Post: 11-18-2013, 11:28 PM
  6. Convert matrix into column data
    By Misheel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-22-2013, 12:17 PM
  7. Replies: 0
    Last Post: 04-23-2012, 10:06 AM

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