+ Reply to Thread
Results 1 to 8 of 8

lookup for last value

  1. #1
    Registered User
    Join Date
    01-22-2014
    Location
    Compton, whup whup
    MS-Off Ver
    Excel 2010
    Posts
    108

    lookup for last value

    I have a report that is formatted horribly. The rows always increase and there are no unique identifiers to use as lookups. As such, I want to do a lookup on the LAST incident of a name. For example, in row B, there are 50 "Real Estates", I want to lookup the last one and return the value three columns over.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: lookup for last value

    Try this:

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    01-22-2014
    Location
    Compton, whup whup
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: lookup for last value

    Thanks Alan, but is there a way to do this with a formula? I have a number of lookups that I need to do.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: lookup for last value

    Can you post some example data in a workbook?

    Pete

  5. #5
    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,936

    Re: lookup for last value

    Perhaps use a helper column with countif() in it, then do a search (using index/match) based on a combination of the entry and the qty?
    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

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

    Re: lookup for last value

    hi there. maybe something like this would work:
    =LOOKUP(2,1/(B2:B10="real estate name"),E2:E10)

    to handle increasing range, make it more than it'll ever reach (not the whole columns for this case though) or consider dynamic ranges and Tables. you can google more for that

    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

  7. #7
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: lookup for last value

    Assumed your data in Column A and down:

    =IF(COUNTA(A:A)=0,"",INDEX(A:A,MAX((A:A<>"")*(ROW(A:A))),0))
    (Array Formula

    Azumi

  8. #8
    Registered User
    Join Date
    01-27-2013
    Location
    New Mexico
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: lookup for last value

    Looks like you have three options and they all work. This is mine.

    =INDEX(A1:D100,MATCH(2,1/(A1:A100=*Cell reference or name reference*)),4)

    Assumed:

    Real estate name is in column A
    Value you want to return is in column D
    *You can change the cell reference to a number that will never be reached
    *Be sure to enter using CTRL + SHIFT + ENTER, not just enter

    Edited for dynamic range:

    =INDEX(A1:INDEX(D:D,MATCH(9E+307,D:D)),MATCH(2,1/(A1:INDEX(A:A,MATCH("ZZZZZZ",A:A))=*Cell reference or name reference*)),4)

    Same rules apply to this formula, but it's a dynamic range, so you don't need to worry about picking a row number. It will always use the highest row number where there is data.
    Last edited by dropanddrive03; 01-23-2014 at 03:47 AM.

+ 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] Lookup question matching part of lookup value in the table array
    By kosmo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2013, 11:07 AM
  2. Replies: 2
    Last Post: 05-19-2013, 08:46 AM
  3. Replies: 1
    Last Post: 11-07-2012, 01:57 PM
  4. Search lookup array to find lookup value contained within text string
    By Cookstein2 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-02-2011, 09:42 AM
  5. Replies: 7
    Last Post: 06-19-2011, 12:51 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