+ Reply to Thread
Results 1 to 7 of 7

Counting the latest row of a number?

  1. #1
    Registered User
    Join Date
    09-08-2014
    Location
    New York
    MS-Off Ver
    2010
    Posts
    12

    Counting the latest row of a number?

    Hello,

    what functions I have to use to solve this problem.
    I have a table, with 3 columns (1,2,3). Below that are a lot of numbers (0 and 1).
    I want to know the ROW of the latest number 1 in each column. Number 1 can be a duplicate in each column and I only want
    to get the row of the latest number one ...

    For better understanding I upload this excel document: one.xlsx

    P.S. There is an example in the document how the results should be like.
    Last edited by figeroa; 10-19-2014 at 12:16 PM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Counting the latest row of a number?

    In A24 use this array formula

    =MAX((A2:A20=1)*ROW(A2:A20))

    Confirm with Ctrl+Shift+Enter and not just Enter

    Copy across
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Counting the latest row of a number?

    =lookup(9^9,1/(A2:A20=1),ROW(A2:A20))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Counting the latest row of a number?

    Hi,

    another approach could be:

    Please Login or Register  to view this content.
    Cheers
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  5. #5
    Registered User
    Join Date
    09-08-2014
    Location
    New York
    MS-Off Ver
    2010
    Posts
    12

    Re: Counting the latest row of a number?

    Quote Originally Posted by canapone View Post
    Hi,

    another approach could be:

    Please Login or Register  to view this content.
    Cheers


    Thank you on your answer, please can you explain how this function works, I don't understand why is number 2 after bracket?

  6. #6
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Counting the latest row of a number?

    Hi, thanks for your kind feedback


    This segment:

    1/(A2:A20)

    will return an array of either 1/1 and 1/0.

    1/1 = 1

    1/0 = #DIV/0!

    LOOKUP reads an array of 1s and #DIV/0! errors. 2 is the lookup value. LOOKUP is searching a 2.
    The lookup value is greater than any number in the array of 1s and #DIV/0! errors, then the formula will look for (match) the last number in the array that is less than the lookup value (2).

    The only and the largest number produced by formula in the array is 1, so every number in the array (1,error,1,1,error) is less than the lookup value of 2 and returns the corresponding result as expected.

    LOOKUP ignores and skips error.

    Same results if you'd change 2 (the first argument of LOOKUP) with every number greater than 1.


    =Lookup(7,1/(A2:A20),Row(A2:A20))

    or

    =Lookup(3,1/(A2:A20),Row(A2:A20))



    Cheers

    Edit: here you can find another example and same attempt to explain (in a poor English) =LOOKUP(2,...

    http://www.excelforum.com/excel-form...ml#post3865208
    Last edited by canapone; 10-19-2014 at 01:35 PM.

  7. #7
    Registered User
    Join Date
    09-08-2014
    Location
    New York
    MS-Off Ver
    2010
    Posts
    12

    Re: Counting the latest row of a number?

    Thank you again

+ 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] Counting cells excluding the highest 2 outcomes
    By Christopherdj in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-19-2013, 12:43 AM
  2. Replies: 0
    Last Post: 09-06-2012, 10:41 AM
  3. Counting the Highest value within cell with mulitple values
    By ROB40160 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-04-2012, 01:21 AM
  4. VBA code to find highest and 2nd highest number based in criteria
    By Michael007 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-25-2011, 08:38 AM
  5. Replies: 3
    Last Post: 08-10-2006, 11:40 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