Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 333
Default If statement to compare for wildcard value in another cell.

Hello,

I need to compare for a value contained within another cell. I need to test
for a portion within the cell so I'm using wildcards. I have tried various
combinations but it's not working. What am I missing?

Here is one I've tried.

=IF(n2=*g2*,1,0)

Thanks for your help,



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default If statement to compare for wildcard value in another cell.

Hi!

Try this:

=ISNUMBER(SEARCH(G2,N2))*1

Biff

"Karen53" wrote in message
...
Hello,

I need to compare for a value contained within another cell. I need to
test
for a portion within the cell so I'm using wildcards. I have tried
various
combinations but it's not working. What am I missing?

Here is one I've tried.

=IF(n2=*g2*,1,0)

Thanks for your help,





  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 333
Default If statement to compare for wildcard value in another cell.

thanks Biff.

the data is text and what I'm testing for could have text before it and
after it. I used your suggestion but tried substituting ISTEXT but it did
not work. The statement should have been true and returned 1 but it returns
0.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default If statement to compare for wildcard value in another cell.

Hi!

I used your suggestion but tried substituting ISTEXT but it did
not work


Do you mean you tried this:

=ISTEXT(SEARCH(G2,N2))*1

If so, ISNUMBER/ISTEXT has nothing to do with the data type of the SEARCH
value.

You use ISNUMBER because if the SEARCH string is found, SEARCH returns the
number position of the string where it was found then that value is passed
to ISNUMBER which will evaluate to TRUE and finally, *1 will convert the
boolean TRUE to numeric 1.

So, using ISTEXT together with SEARCH in this manner will *ALWAYS* evaluate
to FALSE.

Try it as I suggested. If that doesn't work then post an example (or two).

Biff

"Karen53" wrote in message
...
thanks Biff.

the data is text and what I'm testing for could have text before it and
after it. I used your suggestion but tried substituting ISTEXT but it did
not work. The statement should have been true and returned 1 but it
returns
0.

Any ideas?

thanks

"Biff" wrote:

Hi!

Try this:

=ISNUMBER(SEARCH(G2,N2))*1

Biff

"Karen53" wrote in message
...
Hello,

I need to compare for a value contained within another cell. I need to
test
for a portion within the cell so I'm using wildcards. I have tried
various
combinations but it's not working. What am I missing?

Here is one I've tried.

=IF(n2=*g2*,1,0)

Thanks for your help,








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
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
How do I compare cells and if FALSE compare to next cell in EXCEL Cindie Excel Worksheet Functions 0 March 24th 06 05:29 PM
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


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