+ Reply to Thread
Results 1 to 6 of 6

Extract value from last period with data

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Extract value from last period with data

    I am trying to extract the data from one of three different arrays. If there is a value in period 2016, use that. But if there is no value in 2016, go back to 2015. If there is a value there, use that. If there isn't, check 2014. If a value there, use that. If no value in any of the arrays, return zero.

    I can do it with nested 'If' statements but I am looking for a more elegant solution.

    I have attached a sample. Grateful for any ideas.
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Extract value from last period with data

    This uses mostly brute force.

    =IFERROR(IFERROR(IFERROR(1/(1/VLOOKUP(M9,$J$9:$K$18,2,0)),1/(1/VLOOKUP(M9,$G$9:$H$18,2,0))),1/(1/VLOOKUP(M9,$D$9:$E$18,2,0))),0)
    Dave

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Extract value from last period with data

    This is long. It can be made more robust with some modifications.

    =INDEX(INDEX($D$9:$K$18,,MATCH(2,1/MMULT({1,1,1,1,1,1,1,1,1,1},(M9=$D$9:$J$18)*ISNUMBER($E$9:$K$18)),1)+1),MATCH(M9,INDEX($D$9:$K$18,,MATCH(2,1/MMULT({1,1,1,1,1,1,1,1,1,1},(M9=$D$9:$J$18)*ISNUMBER($E$9:$K$18)),1)),0))

  4. #4
    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
    52,939

    Re: Extract value from last period with data

    Perhaps this?
    =INDEX(D9:K9,MATCH(0,D9:K9,-1))
    copied down
    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

  5. #5
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Extract value from last period with data

    Thank you (again), works perfectly.

  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
    52,939

    Re: Extract value from last period with data

    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)

Similar Threads

  1. [SOLVED] Extract first date from specific period counting working days only
    By nicoan in forum Excel General
    Replies: 2
    Last Post: 06-20-2014, 11:24 PM
  2. How to extract unique value within a specific period of time
    By darwisku in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-23-2014, 08:37 AM
  3. [SOLVED] Extract the word between last backslash and before the period
    By mishaq in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-14-2014, 03:15 AM
  4. Extract text right after period
    By DaronneBonneau in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-04-2013, 11:40 AM
  5. [SOLVED] Complicated:Calculate time period based on no. of units sold + fluctuations within period
    By omaha.crab in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 03:04 AM
  6. extract numbers before period
    By cbridges in forum Excel General
    Replies: 4
    Last Post: 01-27-2012, 01:00 PM
  7. Replies: 2
    Last Post: 08-06-2011, 11:15 AM

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