+ Reply to Thread
Results 1 to 4 of 4

Picking the last non-zero value in a row

  1. #1
    Registered User
    Join Date
    11-04-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Picking the last non-zero value in a row

    I'm trying to work out how I can get a cell to pick up the last non-zero value in that row. I can move the data manually but would appreciate any ideas on how to do it more efficiently.

    Any thoughts much appreciated!

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Picking the last non-zero value in a row

    Perhaps

    =LOOKUP(2,1/(1:1<>0),1:1)

    Not clear though if the values are sorted at all - if so things become simpler.

  3. #3
    Registered User
    Join Date
    11-04-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Picking the last non-zero value in a row

    I've never really used LOOKUP before; I've made it do what I want to do but I don't really understand how it works.

    =LOOKUP(2,1/(G6:AD6<>0),G6:AD6)

    returns the value I'm looking for. There will be data entered in each of those columns on a monthly basis, and that now picks up the last value in the row.

    It doesn't need to be ordered or formatted, just moved into that column and I can reference it from other sheets.

    What does the 2,1 part of the formula do?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: Picking the last non-zero value in a row

    There's no 2,1 part of the formula.

    First step, 2 is looking for value 2 in a range.

    Second step: 1/something can never be 2 (you could put any number greater than 1 in First step) for numbers greater than 1.

    Therefore, formula look until end and return last value since it don't find 2.
    Never use Merged Cells in Excel

+ 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