+ Reply to Thread
Results 1 to 6 of 6

Use HLookup to find last row of data in a column

  1. #1
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Use HLookup to find last row of data in a column

    Hi All

    I need a hlookup formula that will find the last row value but i dont know which row that will be as the data table array will grow daily as more sales are added to the data.
    The HLookup will find the sales advisors name but I then need it to find the last vertical row within that column.

    Hope that makes sense.
    Thanks
    Mark

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

    Re: Use HLookup to find last row of data in a column

    hi Mark. as you might already know, a sample excel file explains much more. say your data is as such.
    Data Range
    A
    B
    C
    D
    E
    1
    Adam
    Benne
    Charlie
    Dylan
    2
    17-Jan-14
    845
    71
    311
    870
    3
    18-Jan-14
    313
    547
    320
    580
    4
    19-Jan-14
    822
    395
    699
    540
    5
    20-Jan-14
    41
    781
    199
    530

    a HLOOKUP for Benne for the last data would be:
    =HLOOKUP("Benne",A1:E5,5,0)

    if your concern is how to get 5, then:
    =HLOOKUP("Benne",A1:E5,COUNTA(A:A)+1,0)

    COUNTA counts how many non-blank cells are filled in Column A. i added 1 for the blank cell in A1 i must also count.

    if i want to base on whichever name column, then:
    =HLOOKUP("Benne",A1:E5,COUNTA(INDEX(B:E,,MATCH("Benne",B1:E1,0))),0)

    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
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Use HLookup to find last row of data in a column

    Hi,

    The usual way to find the last row in a column of numeric values is
    Please Login or Register  to view this content.
    of course you can be a little more realistic with the lookup value. If you know for certain that the column will never exceed a particular value then use that value instead of the largest possible 9.99.....E+307
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Use HLookup to find last row of data in a column

    another is using benishiryo's table where g1 contains the name of interest
    =LOOKUP(10^99,INDEX($A$1:$E$20,,MATCH($G$1,$A$1:$E$1,0)))
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: Use HLookup to find last row of data in a column

    Hi All

    Thanks for the replies. With more study then this is more complex than i initially thought.
    I have attached the excel sheet in the format I will be using it.
    The data I need to find is the "Sales Order Value SAPCO" which in this example starts in column F for the 1st employee & finishes in column Z. This however may not be the case in each store in the company as we all have different size teams. So the formula needs to recognise to start HLookup @ "Sales Order Value SAPCO" & finish @ ""GIS Value of Order".

    The value I need it to find is the last value in the column under each employee, again this will change daily as more sales are added throughout the period.

    The lookup value will be the employee number in row 14 & i don't expect this will change but is there a way around this if it did?

    Many thanks
    Mark
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: Use HLookup to find last row of data in a column

    Using Martin's formula above, it seems to have worked & only finds first employee number & then uses that data so seems all good.
    Thank you.

    =IF(ISNA(LOOKUP(10^99,INDEX('Data Drop'!$F$14:$AZ$10000,,MATCH($B10,'Data Drop'!$F$14:$AZ$14,0)))),"",LOOKUP(10^99,INDEX('Data Drop'!$F$14:$AZ$10000,,MATCH($B10,'Data Drop'!$F$14:$AZ$14,0))))

+ 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] Using HLOOKUP and attempting to find the 2nd row and one cell over
    By sc0o8i3 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-02-2014, 08:04 AM
  2. Nesting vlookup and hlookup to find a value
    By macquarl in forum Excel General
    Replies: 1
    Last Post: 10-15-2010, 05:04 PM
  3. HLOOKUP, then find SMALL in that column?
    By DavidNYC in forum Excel General
    Replies: 2
    Last Post: 09-21-2009, 02:54 AM
  4. How to use HLOOKUP or other command to find a value within a range
    By antwash in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-08-2006, 12:10 PM
  5. [SOLVED] How do I find a value in an array (VLOOKUP? HLOOKUP?)
    By M Skabialka in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-10-2005, 11: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