+ Reply to Thread
Results 1 to 11 of 11

How to return the last cell in a column that LOOKUP isn't working for

  1. #1
    Registered User
    Join Date
    07-01-2019
    Location
    Las Vegas, NV
    MS-Off Ver
    2016
    Posts
    5

    How to return the last cell in a column that LOOKUP isn't working for

    Hello,

    I'm trying to figure out how to write a formula that returns the last cell with a value in a column. I've looked all over the internet and I keep seeing this "LOOKUP(lookup_value, lookup_vector, [result_vector])" as an answer but it doesn't work for me. Also INDEX and MATCH all need something to reference off and doesn't work for me either, which is my issue with VLOOKUP. The sheet I'm making is a Dispatch time keeper for all of our drivers and throughout the day the drivers check-in with us. I have a master table that reports simple things at a glance but I want to add columns for Time, Initials, Stop # and ETA. So i need the info from Pic A to go to Pic B. Any idea will be welcome because I'm STUMPED. Thank you.

    Pic A.JPG

    Pic B.JPG

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,628

    Re: How to return the last cell in a column that LOOKUP isn't working for

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced next to "Post Quick Reply" button at the bottom right of the editor box.
    • Scroll down until you see "Manage Attachments",
    • Click the "Choose" button at the upper left (upload from your computer).
    • Select your file, click "open", click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Close the Attachment Manager window.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    07-01-2019
    Location
    Las Vegas, NV
    MS-Off Ver
    2016
    Posts
    5

    Re: How to return the last cell in a column that LOOKUP isn't working for

    Here is a test workbook that protonLeah advised me to add. Thanks.

    Im trying to get A42:B85 to return the last cell with a value to AG3, and so on with C41:C85 to AH3.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,628

    Re: How to return the last cell in a column that LOOKUP isn't working for

    Merging cells always complicates worksheet formulas.

    1. Use a dynamic named range for the driver check-in range:
    name: DriverCheckIn
    refers to:
    Please Login or Register  to view this content.
    To point TO the last row of the range, you will use the ROWS() function to return the current number of rows, so in
    AG3:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-01-2019
    Location
    Las Vegas, NV
    MS-Off Ver
    2016
    Posts
    5

    Re: How to return the last cell in a column that LOOKUP isn't working for

    Thank you I tried it and it worked for a bit. How would I shorten the formula to include only the specific range and not the entire column?

    Now my problem is there will be close to 100 routes all stacked on top of each other, with 100 route names in the little table at the top. So when I added another route tracker named Test Route 2 and put value in the Driver Check-In area (which I changed the range name to DriverCheckIn2) the data returned in the table, AG3:AJ3, was for the Driver Check-In for test route 2. I spent about 4 hours trying different ways to only include that one area A42:F85 but it seems nothing I did helped.

    Would there be a different way that returns only one column at a time? Maybe a formula that returns only last cell in A42:B85, C42:C85, D42:D85, Etc?

    Please and Thank you.

  6. #6
    Registered User
    Join Date
    07-01-2019
    Location
    Las Vegas, NV
    MS-Off Ver
    2016
    Posts
    5

    Re: How to return the last cell in a column that LOOKUP isn't working for

    Sorry, I forgot to add the workbook. I added Test route 2 and 3 to show what I'm talking about.
    Attached Files Attached Files

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: How to return the last cell in a column that LOOKUP isn't working for

    Please try at
    AG3
    =LOOKUP(9^9,INDEX($A:$A,79*(ROWS(AG$2:AG2)-1)+42):INDEX($A:$A,79*(ROWS(AG$2:AG2)-1)+85))
    AH3:AJ3
    =VLOOKUP($AG3,INDEX($A:$A,79*(ROWS(AH$3:AH3)-1)+42):INDEX($E:$E,79*(ROWS(AH$3:AH3)-1)+85),COLUMNS($AF3:AH3),)

  8. #8
    Registered User
    Join Date
    07-01-2019
    Location
    Las Vegas, NV
    MS-Off Ver
    2016
    Posts
    5

    Re: How to return the last cell in a column that LOOKUP isn't working for

    That works for AG3 and AH3 but AI3 and AJ3 just repeat AH3.

    And what would I change in that formula to put the Driver Check-In in Test Route 2 in AG4:AJ4?

    Thanks a lot, I think I'm close to what I need.
    Last edited by Zypheris; 07-02-2019 at 03:56 PM.

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: How to return the last cell in a column that LOOKUP isn't working for

    Quote Originally Posted by Zypheris View Post
    That works for AG3 and AH3 but AI3 and AJ3 just repeat AH3.
    =VLOOKUP($AG3,INDEX($A:$A,79*(ROWS(AH$3:AH3)-1)+42):INDEX($E:$E,79*(ROWS(AH$3:AH3)-1)+85),COLUMNS($AF3:AH3),)
    Please check last term no $ in front of AH3

    Quote Originally Posted by Zypheris View Post
    And what would I change in that formula to put the Driver Check-In in Test Route 2 in AG4:AJ4?
    Select AG3:AJ3 and drag the formula down.

    If this not work, Please upload sheet with the formula that not work.

  10. #10
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,628

    Re: How to return the last cell in a column that LOOKUP isn't working for

    AG3:
    Please Login or Register  to view this content.
    Drag across and manually change the column numbers (1,3,4,5) because of the merged cells in A:F.

  11. #11
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: How to return the last cell in a column that LOOKUP isn't working for

    Try these formulas

    In AG2 then drag down

    Please Login or Register  to view this content.
    In AH2 then drag across up to column AJ
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ 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] 2 cell text lookup in text string to return data from separate column
    By Zivhodiva in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-08-2019, 03:03 PM
  2. [SOLVED] Lookup: Lookup employee id and return value in cell x basued on most recent start date
    By jekeith in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-21-2018, 12:56 PM
  3. Replies: 8
    Last Post: 09-21-2017, 03:43 PM
  4. lookup for a cell value in entire sheet and return value from a column
    By atulkumar.goel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-22-2014, 01:38 PM
  5. Lookup a blank cell in a Lookup table and return a figure.
    By jonnops in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-20-2014, 07:33 AM
  6. Replies: 3
    Last Post: 01-27-2014, 07:17 AM
  7. Replies: 4
    Last Post: 03-13-2013, 12:38 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