+ Reply to Thread
Results 1 to 6 of 6

Find the Position of String in a comma separated cell

  1. #1
    Registered User
    Join Date
    11-03-2014
    Location
    hubli
    MS-Off Ver
    2013
    Posts
    9

    Find the Position of String in a comma separated cell

    Hi,

    Is there a way to count the position of a string in a comma separated cell.

    For Ex: 1. Sun, Mon, Tue.
    2. Mon, Tue, Sun, Wed.

    Here I want to find the position of the String "Sun" ------> In the first case Answer should be "1" and in the 2nd case answer should be "3".

    Thanks

  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 the Position of String in a comma separated cell

    Try this...

    Data Range
    A
    B
    C
    D
    4
    Data
    Find
    Position
    5
    Sun, Mon, Tue
    Sun
    1
    6
    Mon, Tue, Sun, Wed
    3
    7
    Wed, Thu, Fri, Sun
    4
    8
    ------
    ------
    ------
    ------


    This formula entered in D5 and copied down:

    =LEN(LEFT(A5,SEARCH(C$5,A5)))-LEN(SUBSTITUTE(LEFT(A5,SEARCH(C$5,A5)),",",""))+1
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  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: Find the Position of String in a comma separated cell

    if exactly the above is the case try below formula
    =IFERROR(INT((SEARCH("Tue",A1)+5)/5),"")
    Please Login or Register  to view this content.
    Samba

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

  4. #4
    Registered User
    Join Date
    11-03-2014
    Location
    hubli
    MS-Off Ver
    2013
    Posts
    9

    Re: Find the Position of String in a comma separated cell

    @nflsales
    Thanks

  5. #5
    Registered User
    Join Date
    11-03-2014
    Location
    hubli
    MS-Off Ver
    2013
    Posts
    9

    Re: Find the Position of String in a comma separated cell

    @Tony Valko

    Thanks this solved the problem

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

    Re: Find the Position of String in a comma separated cell

    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. [SOLVED] Dynamic COUNTIF function looking for text value in comma-separated string
    By thewhawk in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-27-2017, 06:29 PM
  2. [SOLVED] Comma separated string element count
    By icyrius in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-30-2017, 10:58 AM
  3. [SOLVED] Report position within a comma separated cell
    By MileHigh_PhD in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-04-2015, 11:53 PM
  4. Find the earliest date within comma-separated values
    By Niclal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2014, 10:08 AM
  5. Formula help on comma separated String data?
    By JGTExcel in forum Excel General
    Replies: 5
    Last Post: 02-10-2012, 01:05 PM
  6. Formula help on comma separated String data?
    By JGTExcel in forum Excel General
    Replies: 1
    Last Post: 02-09-2012, 03:33 AM
  7. Comma separated string
    By ESF in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2011, 06:39 AM

Tags for this Thread

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