+ Reply to Thread
Results 1 to 4 of 4

Search comma separated values in the next cell

Hybrid View

avmax Search comma separated values... 02-03-2023, 10:11 AM
Mumps1 Re: Search comma separated... 02-03-2023, 10:58 AM
vichopalacios Re: Search comma separated... 02-09-2023, 04:13 PM
avmax Re: Search comma separated... 02-11-2023, 09:29 AM
  1. #1
    Registered User
    Join Date
    08-13-2017
    Location
    India
    MS-Off Ver
    365
    Posts
    7

    Search comma separated values in the next cell

    Hi All,

    I am looking for to solve a problem where I need to search for a each value in a cell which has comma separated values and check if it is available in another cell.

    Ex. Cell A1 has A,B,C
    Cell B1 has B,C,X

    Cell C1 = Yes ( As Cell B1 because we can find B & C )

    If any values from the comma separated from A1 is present in B1 , I am trying get a Yes result in C1.

    Any ideas ? Would help a lot.

    Thanks In advance.
    Attached Files Attached Files
    Last edited by avmax; 02-06-2023 at 08:40 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Search comma separated values in the next cell

    It would be easier to help and test possible solutions if you could attach a copy of your file which contains a little more data. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary). See the yellow banner at the top of this page for instructions to attach a file.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Search comma separated values in the next cell

    Hi @avmax
    Try this:


    Sub myTest()
    Dim X
    Dim Y
    Dim LRow As Long
    Dim i As Integer, j As Integer, k As Integer
    Dim Z As Boolean
    LRow = Cells(Rows.count, 2).End(xlUp).Row
    For k = 2 To LRow
        Z = False
        X = Split(Cells(k, 2), ",")
        Y = Split(Cells(k, 3), ",")
        For i = LBound(X) To UBound(X)
            For j = LBound(Y) To UBound(Y)
                If X(i) = Y(j) Then
                    Z = True
                    Cells(k, 4).Value = "Yes"
                    GoTo GoNext
                End If
            Next j
        Next i
    GoNext:
    If Z = False Then Cells(k, 4).Value = "No"
    Next k
    End Sub
    Barriers are there for those who don't want to dream

  4. #4
    Registered User
    Join Date
    08-13-2017
    Location
    India
    MS-Off Ver
    365
    Posts
    7

    Re: Search comma separated values in the next cell

    Thank you vichopalacios.

+ 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] Search Comma Separated Values with One Result
    By Toddlock in forum Excel Formulas & Functions
    Replies: 35
    Last Post: 10-30-2022, 02:01 PM
  2. [SOLVED] MIN & MAX from Comma Separated Values in Cell
    By ranjan20 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-12-2021, 12:28 PM
  3. Replies: 4
    Last Post: 12-01-2020, 01:20 PM
  4. Replies: 2
    Last Post: 07-26-2019, 12:11 AM
  5. [SOLVED] Vlookup or Index to search and return multiple values in one cell separated by a comma
    By Trnecessary in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 10-17-2018, 12:59 PM
  6. Vlookup or Index to search and return multiple values in one cell separated by a comma
    By Trnecessary in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2018, 10:37 AM
  7. Doing a look up on a cell with comma separated values
    By floragraga in forum Excel General
    Replies: 3
    Last Post: 05-10-2017, 04:35 PM

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