+ Reply to Thread
Results 1 to 8 of 8

LookUp Help

  1. #1
    Registered User
    Join Date
    05-01-2013
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    46

    LookUp Help

    I have a spreadsheet that has up to 200 facilities and each facility will be listed up to 6 times. The sheet has current month and the last date of the previous month. I need to do a look up to pull the previous months total to be on the current months row.

    Example
    Month Current Previous
    1/31/2012 $100
    2/29/2012 $500 $100

    Can this be done if so how

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: LookUp Help

    With your posted example in A1:C3
    This regular formula returns the Col_B value where the Col_A date equals the last date of the month prior to the current row's date
    C3: =INDEX(B$1:B2,MATCH(EOMONTH(A3,-1),A$1:A2,0))

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    05-01-2013
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    46

    Re: LookUp Help

    I get alot of #REF! errors. Each facility will be listed 6 times with 6 different dates, is this what messing it up?

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: LookUp Help

    Can you post a sample worksheet so we can see specificaly what you are trying to do?

  5. #5
    Registered User
    Join Date
    05-01-2013
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    46

    Re: LookUp Help

    I have attached the example. thank you guys again for you help
    Attached Files Attached Files

  6. #6
    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,053

    Re: LookUp Help

    Try this array formula in E2 (the table should copy it down for you)...
    =iferror(INDEX(C$2:C2,MATCH(A2&EOMONTH(C2,-1),A$2:A2&C$2:C2,0),1),"")
    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL-SHIFT-ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Note: not all months have a "previous" month
    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

  7. #7
    Registered User
    Join Date
    05-01-2013
    Location
    Utah
    MS-Off Ver
    Excel 2013
    Posts
    46

    Re: LookUp Help

    That worked. Thank you so much. I can now sleep tonight.

  8. #8
    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,053

    Re: LookUp Help

    Happy to help and thanks for the feedback

+ 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