[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Hi, issue with searching a set of strings in excel

Posted on 2016-10-24
2
Medium Priority
?
53 Views
Last Modified: 2016-11-21
In excel, I have data in column A and I need to search for set of strings in column A. I should get findings in column B.
Ex:
column A                          column B result
Apple                                 no findings
Pen                                    found pen  
pen in the Book               found pen,book
Cat                                     no findings                      
House                                found house
Deer                                   no findings
elephant house               found elephant,house

I need to search pen,book,house,elephant in column A and in corresponding column I have to get found pen,found house.....

I can do this with if condition but the data that I have is huge and so taking lot of time for execution. can this be done with some inbuilt excel functions like search({"pen","house","...},A:A).....????
0
Comment
Question by:sai k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 41858061
Hi,

pls try
Sub macro()
aFind = Split("pen,book,house,elephant", ",")
For Each c In Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
strFound = ""
    For Each Item In aFind
        If LCase(c) Like "*" & LCase(Item) & "*" Then
            strFound = strFound & "," & Item
        End If
    Next
    If strFound <> "" Then
        c.Offset(, 1) = "found " & Right(strFound, Len(strFound) - 1)
    Else
        c.Offset(, 1) = "no findings"
    End If
Next
End Sub

Open in new window

Regards
0
 
LVL 14

Expert Comment

by:frankhelk
ID: 41895634
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Rgonzo1971 (https:#a41858061)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

frankhelk
Experts-Exchange Cleanup Volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question