+ Reply to Thread
Results 1 to 4 of 4

second latest date, invoice and balance

  1. #1
    Registered User
    Join Date
    06-12-2016
    Location
    Malaysia
    MS-Off Ver
    2010
    Posts
    2

    second latest date, invoice and balance

    I know find second largest date can use LARGE formula, but I not very expert on how can I find SECOND latest date, invoice# and balance based on name & code IF the initial balance is show zero or negative. Attached is sample data in excel format which I have simplified to make it easy to understand.
    Attached Files Attached Files
    Last edited by shyshine; 06-12-2016 at 10:20 AM.

  2. #2
    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: second latest date, invoice and balance

    Hi

    Perhaps you could give a few more examples and manually add the results you expect in columns G:I

    I can see no 2nd occurrence of Banana..C12345D in the range A8:B14 so not sure what you expect.
    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.

  3. #3
    Registered User
    Join Date
    06-12-2016
    Location
    Malaysia
    MS-Off Ver
    2010
    Posts
    2

    Re: second latest date, invoice and balance

    Hi Richard,
    I have manually add in the result that i expected for Apple row, cell G to I.

    My problem is,IF the balance at cell E show Positive figure, I can stop at here, no need go to further step, leave it blank. What IF cell E give me balance of Zero or Negative figure, then i need to find out again the second latest date, invoice and balance for cell G-I.

    Since Banana row give positive figure, therefore no action needed. So it will leave it blank for that row. But Apple row will need to find out again since the balance (cell E) give 0.

    Imaging there is hundred to thousand list of data, it could be same name and different code. Everytime i will need to find out date, invoice and balance from the raw date by based on name and code provided. Instead of manually sort and filter, i hope speed up the work by using formula. The sample provided, hope it's more understand.

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: second latest date, invoice and balance

    G3: =IF($E3<=0,LARGE(IF((A$8:A$14=A3)*(B$8:B$14=B3),C$8:C$14),2),"") ----> Press Ctrl+Shift+Enter, not just Enter

    H3: =IF(G3="","",INDEX(D$8:D$14,MATCH(1,(A$8:A$14=A3)*(B$8:B$14=B3)*(C$8:C$14=G3),0))) ----> Press Ctrl+Shift+Enter, not just Enter

    I3: =IF(G3="","",VLOOKUP(H3,A$18:C$23,3,0)) ----> Normally Enter

+ 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. VBA- Filter Pivot table based on latest and 2nd latest date in column
    By ziyan89 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 12-29-2015, 11:18 AM
  2. Replies: 8
    Last Post: 04-08-2015, 10:10 PM
  3. Need help showing the latest value on balance column for a particular item.
    By kittle08 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-31-2014, 10:17 AM
  4. Replies: 4
    Last Post: 11-04-2012, 12:43 PM
  5. Sort Data According to latest date and lowest balance. Excel 2007
    By Bruce2000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2012, 12:46 PM
  6. Replies: 4
    Last Post: 01-02-2011, 04:30 PM
  7. Formula for capturing the latest balance
    By sayang in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 02-04-2009, 09:42 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