+ Reply to Thread
Results 1 to 7 of 7

Find nth Occurrence of a character in a ROw

  1. #1
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Find nth Occurrence of a character in a ROw

    hi Experts,

    How do i find the second/3rd/4th occurrence of the "B" in row 6?


    Thank you
    If I've helped U pls click on d *Add Reputation

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find nth Occurrence of a character in a ROw

    Post some sample data and tell us what results you expect.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Find nth Occurrence of a character in a ROw

    With data in say C:N and the designated in column B array enter this in A1 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Dave

  4. #4
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Re: Find nth Occurrence of a character in a ROw

    Thank you FlameRetired but how do i get the cell equivalent?

    Tony say in row 1 (A:K) i have

    B A A A L L L A A A B

    what I'm trying to do is count the number of A's between the third occurrence of L and 2nd occurrence of B

    So i figured how to find the 2nd occurrence of L but not the 2nd B.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find nth Occurrence of a character in a ROw

    Try this array formula**:

    =COUNTIF(INDEX(1:1,SMALL(IF(A1:K1="L",COLUMN(A1:K1)),3)):INDEX(1:1,SMALL(IF(A1:K1="B",COLUMN(A1:K1)),2)),"A")

    This array formula** entered in

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Assumes there will always be a 3rd instance of L and a 2nd instance of B.

  6. #6
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Re: Find nth Occurrence of a character in a ROw

    Thanks Biff.. that did the trick

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find nth Occurrence of a character in a ROw

    You're welcome. Thanks for the feedback!

+ 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. replace EACH Nth occurrence a character in a string with another character
    By mattman7 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-23-2016, 12:23 PM
  2. [SOLVED] Getting the string that follows the last occurrence of a character
    By michaljireht in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2014, 10:25 AM
  3. Find each occurrence in a column and do for each occurrence
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2014, 12:29 PM
  4. [SOLVED] find the character position in a string of the last occurrence of a nominated character
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2014, 11:52 PM
  5. Replies: 7
    Last Post: 08-31-2013, 12:30 PM
  6. Cutting off a string at the last occurrence of a character
    By isabelle.r in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2013, 09:42 AM
  7. How to Delete Text Before First Occurrence Of Character?
    By JimMW in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2012, 11:06 AM

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