+ Reply to Thread
Results 1 to 3 of 3

Find first value (from a list) which appears prior to target value

Hybrid View

  1. #1
    Registered User
    Join Date
    07-10-2012
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    Find first value (from a list) which appears prior to target value

    Hello,
    I have quite a complex problem but any assistance provided would be gratefully received.

    I have attached an example spreadsheet that shows my problem. Basically, in column A I have several thousand rows of 3 or 4 letter codes. In column B, I need a formula that will find one particular target code in Col A and then in the adjacent cell in Col B, display the first code to appear in Col A above the target code which matches the list of desired codes.

    So the briefly re-state the problem, I need a formula which finds every case of one particular code in Col A (in the example spreadsheet the code is ABCD), and then read back up Col A to find the first value which matches the desired code (from a list of about 5-10 codes), ignoring other values which represent codes that are not on the list, and place this col B adjacent to the target code.

    I thank you in advance for your assistance

    T15K
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Find first value (from a list) which appears prior to target value

    hi T15K, try this in B2:
    =IF(A2=$D$2,LOOKUP(2,1/(MATCH(A$2:A2,$E$2:$E$4,0)),A$2:A2),"")

    this is provided that at least one of the codes in E2:E4 will appear
    Last edited by benishiryo; 09-27-2013 at 01:07 AM.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    07-10-2012
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Find first value (from a list) which appears prior to target value

    That is an excellent solution. Thank you very much.

+ 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. Replies: 5
    Last Post: 04-23-2013, 05:11 PM
  2. [SOLVED] Find 30 day prior entry in a column of dates
    By jphalverson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 12:13 PM
  3. Replies: 1
    Last Post: 04-11-2006, 12:30 PM
  4. Find the date for monday prior to May 25th
    By Ralph Heidecke in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-04-2006, 08:35 PM
  5. Replies: 0
    Last Post: 08-28-2005, 10:37 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