Find Words From One Range In Another - Excel Help & Excel Macro Help
SEARCH ENTIRE SITE LOADING..

OZGRID Excel Help & Excel Best Practices Forums

Information Helpful? Why Not Donate.

SPECIALS PAGE FOR BARGAINS | BUILD YOUR GOLF SWING | FREE CUSTOM FUNCTIONS ADD-IN


Download Active Data For Excel Demo


Go Back Excel Help & Excel Macro Help > HELP FORUMS > EXCEL HELP
HOME Register Forum Help Calendar Search For Today's Posts Mark Forums Read

Reply

Find Words From One Range In Another

ANSWERS TO SIMILAR QUESTIONS
Find Matching Words In Two ColumnsFind & Highlight Words In CellCount Words In Range Mixed in With Other WordsFind words - deleting the words - and deleting some info after the words.find multiple words in once cell



Javascript DHTML Drop Down Menu Powered by dhtml-menu-builder.com

Create Excel dashboards quickly with Plug-N-Play reports.


 
Thread Tools Search this Thread
Old December 8th, 2006
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
syl syl is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2000
Op System: Windows 2000
Assumed Experience: Just above poor (Basic Formulas SUM etc)
Join Date: 8th December 2006
English is 1st Language:
Posts: 2 -- Threads: 1
Find Words From One Range In Another

I need a way to do the following in Excel:

column A has text
column B needs a Formula that returns specific value(s)
ie. want to find any of 17 specific strings within a row in column A and return that (those) string value(s) in column B

for example row1 column A contains the following:
Troubleshooter Notes: Sound KVSND Tree was not used as doc exists that covered the specific issue

The formula in column B needs to be able to find any of the following values (note: these values could be placed in a lookup table):
"KVBAT" "KVBLTH" "KVDNW" "KVDOC" "KVDWB" "KVFLSH" "KVKBD" "KVLAN" "KVODD" "KVOTH" "KVPFS" "KVRCVY" "KVSB2" "KVSFT" "KVSND" "KVVID" "KVWFI"

and place the found value(s) in row 1 column B

in the above example column B would return the value:
KVSND

the formula needs to be diverse enough to return multiple values if more than 1 value is found

for example row1 column A:
Troubleshooter Notes: Sound KVSND Tree was not used as doc exists that covered the specific issue, Performance Security Troubleshooter KVPFS The system has worked previously performance expectation is being set by previous performance or a message

row 1 column B should return the following values (preferably with a space between each value):
KVSND KVPFS

Thank you for your help,
syl
Print [Post / Thread] Reply With Quote
Old December 8th, 2006
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,878 -- Threads: 15169
Re: Search A Cell If Contains A String That Matches A Range Of Strings

Create 2 Dynamic Named Range. Name the one with "KVBAT" "KVBLTH" "KVDNW" etc as LookRange and the other FindRange. Now run the code below. It will place the matching into the Column (same row as match) to the immediate right of FindRange.
VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes".
Sub FindText() Dim rCell As Range, rFindIn As Range Dim strWord As String, lLoop As Long Dim rFound As Range Set rFindIn = Range("FindRange") For Each rCell In Range("LookRange") strWord = rCell Set rFound = rFindIn.Cells(1, 1) For lLoop = 1 To WorksheetFunction. CountIf(rFindIn, "*" & strWord & "*") Set rFound = rFindIn. Find(What:=strWord, After:=rFound, LookIn:=xlValues, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False) rFound(1, 2) = strWord Next lLoop Next rCell End Sub

Last edited by Dave Hawley : December 8th, 2006 at 15:25.
Print [Post / Thread] Reply With Quote
Old December 8th, 2006
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
syl syl is offline
I agreed to these rules
 
I'm a Spammer:
MS Office Version: 2000
Op System: Windows 2000
Assumed Experience: Just above poor (Basic Formulas SUM etc)
Join Date: 8th December 2006
English is 1st Language:
Posts: 2 -- Threads: 1
Re: Find Words From One Range In Another

Thank you Dave Hawley for your quick response. You ROCK!
I will definately try this tomorrow when I get back to work. This will save me a lot of time (as I spent all day trying to figure this out with basic excel formulas and got nowhere).
I am wondering if it would be a big or small modification to have the returned value in a non-adjacent cell for example instead of returning the value in row 1 column B, having the value returned in row 1 column Z? If its a big deal to make that modification then I'll just stick with the great help you have given me.
Print [Post / Thread] Reply With Quote
Old December 8th, 2006
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,878 -- Threads: 15169
Re: Find Words From One Range In Another

The line of code rFound(1, 2) = strWord adds the word next to the row it was found in. The 1 means same row, and the 2 means one column to the right. In other words, to have it placed in the same row 5 columns to the right, it would be rFound(1, 6) = strWord. To have it offset one row down 5 columns to the right it would be rFound(2, 6) = strWord.
Print [Post / Thread] Reply With Quote
Reply Lifetime Upgrade To Ad Free Styles

   « PREVIOUS ASP Generated Spreadsheet. Cannot Copy All || Seperate Numbers & Text From Cell NEXT »
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 20:25.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Ozgrid is Not Associated With Microsoft. Ozgrid Retains the Rights to ALL Posts and Threads