+ Reply to Thread
Results 1 to 3 of 3

finding next instance of text in a cell

  1. #1
    Registered User
    Join Date
    02-08-2007
    Posts
    11

    finding next instance of text in a cell

    Hello,

    I am trying to use excel to calculate the number of button presses in a trial. I have managed to extract the column and row information for the beginning of each trial and I am hoping that someone will be able to help me write a formula that will extract the location (column and row) of the end of each trial so I can use countif to calculate the number of button presses in each trial.

    The end of each trial is marked by the entry of cell marked 'ITI'. Since I already know the location of the beginning of each trial, I just to know how to find the next appearance of ITI in the subsequent rows. For instance the trial begins in cell C42 and it ends somewhere in column C below the 42nd row.

    Thank you very much, and if any more information is necessary, please let me know.

    Paul

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    199
    You may have to adjust the ranges a bit, but it sounds like what you need.

    =IF(ROWS($G$4:G4)<=$G$3,
    CELL("Address",INDEX($A$2:$D$13,
    SMALL(IF($A$2:$D$13=$G$2,ROW($A$2:$D$13)-ROW($A$2)+1),
    ROWS($G$4:G4)),
    SMALL(IF($A$2:$D$13=$G$2,COLUMN($A$2:$D$13)-COLUMN($A$2)+1),
    ROWS($G$4:G4)))),
    "")
    Hope that helps.
    Last edited by VBA Noob; 02-29-2008 at 06:39 PM.

  3. #3
    Registered User
    Join Date
    02-08-2007
    Posts
    11

    much appreciated

    Thanks Claymation! That was exactly what I was looking for!

+ 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