+ Reply to Thread
Results 1 to 9 of 9

(vlookup?) formula to return the first - last value from range which meets condition

  1. #1
    Registered User
    Join Date
    03-13-2012
    Location
    Deventer, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    64

    (vlookup?) formula to return the first - last value from range which meets condition

    Hi there,
    I'm looking for 2 (vlookup?) formulas which will return me resp. the first and last value from a range which meets a given condition (illustrated in attachment):
    . The 1st formula should return the FIRST value (5) next to the 'dog' entry in column A
    . The 2nd formula should return the LAST value (7) next to the 'dog' entry in column A

    Anybody an idea how to do this?

    Regards Niels
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,913

    Re: (vlookup?) formula to return the first - last value from range which meets condition

    Should the first instance of Dog not return 2 rather than 5 as stated above?

    BSB

  3. #3
    Registered User
    Join Date
    03-13-2012
    Location
    Deventer, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: (vlookup?) formula to return the first - last value from range which meets condition

    yes you´re right

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,913

    Re: (vlookup?) formula to return the first - last value from range which meets condition

    OK, just thought I'd check.

    This for first instance:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and this for last instance:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    BSB

  5. #5
    Registered User
    Join Date
    03-13-2012
    Location
    Deventer, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: (vlookup?) formula to return the first - last value from range which meets condition

    They seem to work well. One question I still have is why can´t I you the first formula for the 2nd instance as well, whereby changing FALSE for TRUE?

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,913

    Re: (vlookup?) formula to return the first - last value from range which meets condition

    That's not what the TRUE/FALSE argument of a VLOOKUP does. It is there to dictate whether or not you're looking for an exact match (FALSE) or a close match (TRUE).

    BSB

  7. #7
    Registered User
    Join Date
    03-13-2012
    Location
    Deventer, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: (vlookup?) formula to return the first - last value from range which meets condition

    I noticed that changing FALSE to TRUE returned a 7.. Should I consider this as a coincidence then?

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,913

    Re: (vlookup?) formula to return the first - last value from range which meets condition

    Change "Dog" to "Horse" and still use TRUE. Do you get the expected result then?

    BSB

  9. #9
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,913

    Re: (vlookup?) formula to return the first - last value from range which meets condition

    Worth pointing out that if the list were sorted into alphabetical order on column A then using TRUE would indeed give you the last instance and using FALSE would give you the first.

    BSB

+ 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] Looking for a formula to reference a range of cells and return data if meets criteria
    By jeremyhawg in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-24-2014, 07:19 PM
  2. Replies: 3
    Last Post: 04-20-2013, 09:55 PM
  3. [SOLVED] Return Column Header When Value Meets Condition
    By aerialous in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-16-2012, 06:56 AM
  4. Return value AFTER column meets condition
    By jbc242 in forum Excel General
    Replies: 2
    Last Post: 06-26-2011, 11:40 PM
  5. Return a range of cells that meets a criteria
    By bgallagher1 in forum Excel General
    Replies: 3
    Last Post: 08-14-2010, 04:33 AM
  6. Return a range that meets a specific criteria
    By Brenda Blanchard in forum Excel General
    Replies: 5
    Last Post: 03-26-2009, 11:54 PM
  7. [SOLVED] Formula to return ADDRESS of cell in range that meets criteria
    By Christie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2005, 08:06 PM

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