+ Reply to Thread
Results 1 to 6 of 6

Finding the last non zero value in my column

  1. #1
    Registered User
    Join Date
    10-21-2007
    Posts
    5

    Finding the last non zero value in my column

    Can you take a look at my excel file and tell me how I can find the last non zero number in column D, Is there any other way to approach my goal in this simple worksheet? Thank you.
    Ali
    Attached Files Attached Files

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =LOOKUP(2,1/(D2:D41>0),D2:D41)
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    hi Ali,

    The below thread or its links may help:
    http://excelforum.com/showthread.php?t=618673

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Couldn't the balance legitimately be zero?

  5. #5
    Registered User
    Join Date
    10-21-2007
    Posts
    5
    Yes It can be zero and it can be a negative number too, and this list will get longer eventually.
    Thank you.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Enter this formula in D3 and drag down

    =IF(OR(B3>0,C3>0),D2+B3-C3,"")
    then use this formula

    =LOOKUP(MAX(D:D)+1,D:D)
    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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