#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default IF question

when doing an IF question and I want to have the Logic Test = a single
word in the cells and have it trigger a true or false..

AC21 says "Office/Retail" i want my formula to only read the
"Office" part of it

=IF(AC21="Office","Yes","No")

I want it to still come up as "Yes" in the new cell but it wont
because cell AC21 also says "/Retail"

so the question is.. how do i get my formula to read just the "Office"
part of cell AC21??

something on the lines of "If AC21 has the word "Office" anywhere in
it then the new cell will = "Yes""

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default IF question

One way:

=IF(ISERROR(SEARCH("Office",AC21)),"No","Yes")

HTH,
Paul


--

wrote in message
oups.com...
when doing an IF question and I want to have the Logic Test = a single
word in the cells and have it trigger a true or false..

AC21 says "Office/Retail" i want my formula to only read the
"Office" part of it

=IF(AC21="Office","Yes","No")

I want it to still come up as "Yes" in the new cell but it wont
because cell AC21 also says "/Retail"

so the question is.. how do i get my formula to read just the "Office"
part of cell AC21??

something on the lines of "If AC21 has the word "Office" anywhere in
it then the new cell will = "Yes""



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default IF question

By nesting a SEARCH function inside the IF, you can do what you need:
=IF(SEARCH("office",AC21,1)0,"Yes","No")

SEARCH looks for the string "office" in cell A21 and returns its
position in the string if it is there, or zero if it is not. SEARCH is
similar to FIND, but SEARCH is not case sensitive, where FIND looks
for an exact case match.

Have a good weekend!
Dave O

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default IF question

My error: Paul's kung fu is better. I thought a negative search would
result in zero, as opposed to an error.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default IF question

Thanks guys!! That worked out great =)

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
If Question Carl Excel Worksheet Functions 2 August 16th 06 08:20 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
question. ace New Users to Excel 2 May 5th 06 03:25 PM
an if question jwfakouri Excel Discussion (Misc queries) 3 March 13th 06 11:55 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM


All times are GMT +1. The time now is 08:30 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"