+ Reply to Thread
Results 1 to 7 of 7

Find last value > 0 in range, return corresponding date in column A

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    New York, US
    MS-Off Ver
    2013
    Posts
    43

    Find last value > 0 in range, return corresponding date in column A

    Hi gurus,

    I have a data set with dates in column A and corresponding payments in columns B onward.

    I need a formula that finds the last payment (any value over 0) in a column and returns the date in cell A of the row which has the last payment.

    Payments start at row 126 and currently end at row 827 (this will increase as a new row is inserted each day for new payments).

    I would have the formula in the row directly underneath the last payment row (currently row 828), however this formula row would get pushed down 1 row each day so it needs to be able to adjust to that.

    Example workbook attached.

    Thanks in advance to anyone who takes the time to look at this!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Find last value > 0 in range, return corresponding date in column A

    So cell B828 should return the date 5/7/2013?

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Find last value > 0 in range, return corresponding date in column A

    Try

    =LOOKUP(9.99999999999999E+307,2/(B$1:B$829>0),$A$1:$A$829)

    The key is making the range extend beyond your current last row.
    As long as new data is inserted between rows 827 and 829, then the formula will auto adjust.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,892

    Re: Find last value > 0 in range, return corresponding date in column A

    Try ...in column B828

    =MAX(IF(B$126:B827>0,$A$126:$A827))

    Enter with Ctrl+Shift+Enter


    Copy across.

  5. #5
    Registered User
    Join Date
    07-20-2015
    Location
    New York, US
    MS-Off Ver
    2013
    Posts
    43

    Re: Find last value > 0 in range, return corresponding date in column A

    That's awesome, thanks Jonmo!

    Tweeked it a little so that in row 829 it's

    =TEXT(LOOKUP(9.99999999999999E+307,2/(B$1:B$828>0),$A$1:$A$828),"M/D/YYY")

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Find last value > 0 in range, return corresponding date in column A

    You're welcome.

  7. #7
    Registered User
    Join Date
    07-17-2015
    Location
    Shiraz,Iran
    MS-Off Ver
    MS 2010
    Posts
    12

    Re: Find last value > 0 in range, return corresponding date in column A

    =index(a126:a897,max((row(indirect("1:"&counta(a126:a827))))*((b126:b827)>0)),1)

+ 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. Find latest date in a column and return a value with that date
    By Neyme in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2015, 01:50 PM
  2. Find which date range a date is within and return another column
    By APJo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-17-2014, 08:14 PM
  3. [SOLVED] Find yesterdays date in range and return row number to be used in offset
    By graphicgoose in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-13-2014, 09:20 PM
  4. Find value in range and return data from another column
    By McG_84 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-11-2014, 08:47 AM
  5. [SOLVED] Find a date within a date range and return the header
    By huy_le in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-03-2014, 06:09 PM
  6. [SOLVED] Find first date of the month in range and return column number
    By jben86 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-06-2013, 08:30 PM
  7. Replies: 5
    Last Post: 09-02-2011, 09:17 AM

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