Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Excel > Excel

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 07-12-2018, 10:20 AM
ronnie34 ronnie34 is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Jul 2018
Posts: 2
ronnie34 is on a distinguished road
Question Extracting key words from a cell

Hi, I'm trying to extract some key words from a cell on excell, these keywords being "LHS" and "RHS" from a string of text by using the formulas of FIND, MID, LEFT, RIGHT, TRIM and LEN
I have made the following progress of =MID(B6,FIND({"RHS","LHS"},B6),3)
However, whilst this works for the first cell as it returns "RHS", this is not the same for the remainder where the output should be "LHS".

I was wondering what i may have been doing wrong?



Kind regards
Ronnie
Reply With Quote
  #2  
Old 07-12-2018, 12:46 PM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 618
NoSparks will become famous soon enoughNoSparks will become famous soon enough
Default

Can you attach a small sample workbook showing typically what you're dealing with and indicating what the desired results would be ?
Reply With Quote
  #3  
Old 07-12-2018, 01:06 PM
ronnie34 ronnie34 is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Jul 2018
Posts: 2
ronnie34 is on a distinguished road
Default

I've below attached a dummy example indicating what should appear on the right.
Note that RHS works, however LHS does not.

Many thanks for your help !!
Kind regards
Ronnie
Attached Files
File Type: xlsx dummyexample.xlsx (8.7 KB, 5 views)
Reply With Quote
  #4  
Old 07-12-2018, 11:55 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Windows 7 64bit Office 2010 64bit
Moderator
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,146
Pecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nicePecoflyer is just really nice
Default

Perhaps in C6: =IF(ISNUMBER(SEARCH("RHS",B6)),"RHS","LHS") and pull down as needed
__________________
Problem solved ? Let others know by clicking " Thread Tools" then " Mark thread as solved".( This can be undone if need be)
Reply With Quote
  #5  
Old 07-13-2018, 01:15 AM
ArviLaanemets ArviLaanemets is offline Windows 8 Office 2016
Expert
 
Join Date: May 2017
Posts: 287
ArviLaanemets is on a distinguished road
Default

For C6, the one possible working formula will be
Code:
=IF(LEN(SUBSTITUTE(B6,"RHS",""))<LEN(B6),"RHS",IF(LEN(SUBSTITUTE(B6,"LHS",""))<LEN(B6),"LHS",""))
Reply With Quote
Reply

Tags
excel basic find

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for extracting data from multiple sheets if cell has text plasma33 Excel Programming 0 11-10-2016 12:52 AM
Extracting multiple words from one cell into individual rows while copying all other data randyaserve Excel Programming 4 10-05-2015 09:52 AM
Extracting data from a cell with multiple lines of text MMT Excel 9 02-12-2015 09:18 PM
Excel 2013 need help extracting date and time from text cell plus more. Art Mann Excel 1 07-18-2014 09:55 PM
Extracting Cell color bsaucer Excel 1 06-19-2009 06:52 AM


All times are GMT -7. The time now is 01:56 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft