Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
HedwigVB
 
Posts: n/a
Default 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   Report Post  
Jason Morin
 
Posts: n/a
Default

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   Report Post  
HedwigVB
 
Posts: n/a
Default

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the Find tool in EXCEL TK Excel Worksheet Functions 2 February 11th 05 07:51 PM
How do I find data from a list (or table) and insert it in a row? Bobgolfs56 Excel Discussion (Misc queries) 1 February 3rd 05 12:51 AM
find replace cursor default to find box luffa Excel Discussion (Misc queries) 0 February 3rd 05 12:11 AM
Excel has a "Find Next" command but no "Find Previous" command. Michael Fitzpatrick Excel Discussion (Misc queries) 2 January 10th 05 11:45 PM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 05:45 PM


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"