+ Reply to Thread
Results 1 to 10 of 10

Lookup for moving months

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    Lookup for moving months

    Hello. I'm creating a table that will include a column with numbers for the current year/month as well as a column for prior year/month. In the rows I have different categories. I want to link this table to a tab that has the row headings (for the table) in the left column and the months going across the columns. I could just manually select the cells that I want to include but I want the numbers to update based on the month. So, if I April in a cell, it will automatically grab the data from the year/month (the tab has the dates along the top row). How can I do this? Various methods welcome. Thanks!!!!

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Lookup for moving months

    Hi


    Based on your request, try looking at the MATCH and INDEX functions.


    If you want something more specific to your situation, then attach an example file.

    rylo

  3. #3
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    Re: Lookup for moving months

    Ok thanks. File attached. If you could give various methods of accomplishing it, I would appreciate it. Yeahaaa!!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Lookup for moving months

    Hi

    Based on your example file
    table!B5: =OFFSET(Data!$A$1,ROW()-2,MATCH($B$1,Data!$2:$2,0)-1)

    Do you really need to have multiple methods of getting this result?

    rylo

  5. #5
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    Re: Lookup for moving months

    I really do!! The more the merrier, right Robin Hood?

  6. #6
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    Re: Lookup for moving months

    Also, if you add rows into the first tab, that formula doesn't work No good!!!

  7. #7
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Lookup for moving months

    Hi

    OK, adding rows to the top of the data was not mentioned as a possibility in your original post.

    Here's another couple of options, again for Table!B5
    =OFFSET(Data!$A$1,MATCH(A5,Data!A:A,0)-1,MATCH($B$1,Data!$2:$2,0)-1)
    =INDEX(Data!1:20,MATCH(Table!A5,Data!A:A,0),MATCH(Table!B1,Data!2:2,0))

    For other options, do you want to go down the track of macro solutions that you have to run manually, user defined functions or what?

    Again, there are some expectations of the stability in your data. So if you are not likely to have any stability in structure, and you give advice on what changes could take place, and exactly what parts are likely to remain consistent.

    rylo

  8. #8
    Forum Contributor
    Join Date
    12-12-2012
    Location
    Los Angeles
    MS-Off Ver
    Excel 2010
    Posts
    448

    Re: Lookup for moving months

    That's more like it Rylo. Good stuff!!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: Lookup for moving months

    If you change the fgormula to this, you can add columns...
    =OFFSET(Data!$D$1,ROW()-2,MATCH($B$1,Data!$2:$2,0)-4)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup for moving months

    99% of the time you should avoid using the ROW() function with no argument in any formula. You've just discovered why!

    Not real sure what you want to do this with this.

    How about showing us the expected results in your sample file.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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