+ Reply to Thread
Results 1 to 3 of 3

find previous row for an item

  1. #1
    HedwigVB
    Guest

    find previous row for an item

    Hi,

    I'm looking for a method to find the previous row for an item, eg:
    ! A ! B
    -----+-----+------------------
    1 ! 0 ! Kurt
    2 ! 0 ! Jan
    3 ! 1 ! Kurt
    4 ! 0 ! Peter
    5 ! 2 ! Jan
    6 ! 3 ! Kurt
    7 ! 4 ! Peter
    etc

    Is this possible with a formule? Ifnot can i write a macro to perform this
    operation?

    thx

    Hedwig

  2. #2
    Jason Morin
    Guest

    Re: find previous row for an item

    Put 0 in A1 (it'll always be 0), then copy the formula
    below into A2, press ctrl + shift + enter, and fill down
    the column:

    =IF(COUNTIF($B$1:B1,B2),SMALL(IF($B$1:B1=B2,ROW
    ($B$1:B1)),COUNTIF($B$1:B1,B2)),0)

    HTH
    Jason
    Atlanta, GA

    >-----Original Message-----
    >Hi,
    >
    >I'm looking for a method to find the previous row for an

    item, eg:
    > ! A ! B
    >-----+-----+------------------
    >1 ! 0 ! Kurt
    >2 ! 0 ! Jan
    >3 ! 1 ! Kurt
    >4 ! 0 ! Peter
    >5 ! 2 ! Jan
    >6 ! 3 ! Kurt
    >7 ! 4 ! Peter
    >etc
    >
    >Is this possible with a formule? Ifnot can i write a

    macro to perform this
    >operation?
    >
    >thx
    >
    >Hedwig
    >.
    >


  3. #3
    HedwigVB
    Guest

    Re: find previous row for an item

    GREAT!!! THX!!!

    "Jason Morin" wrote:

    > Put 0 in A1 (it'll always be 0), then copy the formula
    > below into A2, press ctrl + shift + enter, and fill down
    > the column:
    >
    > =IF(COUNTIF($B$1:B1,B2),SMALL(IF($B$1:B1=B2,ROW
    > ($B$1:B1)),COUNTIF($B$1:B1,B2)),0)
    >
    > HTH
    > Jason
    > Atlanta, GA
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >I'm looking for a method to find the previous row for an

    > item, eg:
    > > ! A ! B
    > >-----+-----+------------------
    > >1 ! 0 ! Kurt
    > >2 ! 0 ! Jan
    > >3 ! 1 ! Kurt
    > >4 ! 0 ! Peter
    > >5 ! 2 ! Jan
    > >6 ! 3 ! Kurt
    > >7 ! 4 ! Peter
    > >etc
    > >
    > >Is this possible with a formule? Ifnot can i write a

    > macro to perform this
    > >operation?
    > >
    > >thx
    > >
    > >Hedwig
    > >.
    > >

    >


+ 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