Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Casino Guy
 
Posts: n/a
Default Using 'If' refer to specific words in a cell containing text

Using the 'If' operator I want to refer to a cell containing a text string
but I only want to reference specific words in the text string.

Example: If I refer to a cell containing the text string "Friday Food Sales"
I want to reference only the words "Food Sales"


  #2   Report Post  
swatsp0p
 
Posts: n/a
Default


Is this what you are looking for?:

A1="Friday Food Sales"

B1=IF(FIND("Food Sales",A1),"Found","Not Found")

Result in B1: "Found"


You don't indicate how you want to 'reference' the found string.

HTH

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=393921

  #3   Report Post  
Casino Guy
 
Posts: n/a
Default

The function you wrote works when the condition is true but when the
condition is false it returns #VALUE! instead of Not Found


"swatsp0p" wrote:


Is this what you are looking for?:

A1="Friday Food Sales"

B1=IF(FIND("Food Sales",A1),"Found","Not Found")

Result in B1: "Found"


You don't indicate how you want to 'reference' the found string.

HTH

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=393921


  #4   Report Post  
swatsp0p
 
Posts: n/a
Default


Sorry, guess I didn't test my formula well enough... try this:

=IF(ISNUMBER(FIND("Food Sales",A1)),"Found","Not Found")

Blank cells or numeric cells or text cells not containing the FIND text
will return "Not Found" (adjust this response as desired)

Let me reiterate that FIND is CasE SenSitiVe. "Sales" < "sales"

Good luck

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=393921

  #5   Report Post  
Casino Guy
 
Posts: n/a
Default

Thank you. It works perfectly now. I still don't quite understand why the
first version didn't work.

Stuart


"swatsp0p" wrote:


Sorry, guess I didn't test my formula well enough... try this:

=IF(ISNUMBER(FIND("Food Sales",A1)),"Found","Not Found")

Blank cells or numeric cells or text cells not containing the FIND text
will return "Not Found" (adjust this response as desired)

Let me reiterate that FIND is CasE SenSitiVe. "Sales" < "sales"

Good luck

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=393921




  #6   Report Post  
swatsp0p
 
Posts: n/a
Default


To understand the problem, we need to know what FIND does. It returns
the location number of the first character in the FIND. If it does not
find the value, it returns an error, hence the need to verify that it
returns a number (with ISNUMBER).

Therefore, the formula says that if we have FIND return a number
(meaning it found the value) then tell me you found it, if not, tell me
you didn't find it.

Clearer, now?

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=393921

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I am trying to color fill a cell based on specific criteria jglen Excel Discussion (Misc queries) 1 May 27th 05 05:30 PM
How to refer to a cell format code? A difficult problem Excel Discussion (Misc queries) 1 May 25th 05 08:42 AM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
Highlight a row if a specific cell is specific numbers/words sea0221 Excel Worksheet Functions 2 March 9th 05 12:06 AM
Excel formula for seperating two words in the same cell. Mim New Users to Excel 2 March 8th 05 11:33 PM


All times are GMT +1. The time now is 04:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"