View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steve Jackson
 
Posts: n/a
Default Unable to search for a text value with IF

Yes, it helps but I have a few queries.

What I mean't by "Run numeric ststement" is that I have another table on a
another worksheet that I link this formula to. That part of the formula is
something like (Sheet1!E2*-2)+(Sheet3!B2*20) but it should only run on the
appearance on a specific word in the array as per the initial logital test.

The statement you have suggested works but I get a lot of #N/A errors when
there is no match (i.e. The text value in Sheet1!B2 does not appear in the
range A1:A10). Like you said there would be an error message but is there a
way to remove this and run the "0" value in the IF statement or does it fail
because #VALUE is inbuilt into the MATCH statement when it can't find the
word in the array.

I tried HLOOKUP but not too sure on the syntax. I tried
=IF(VLOOKUP(Sheet2!A2,Sheet1!A1:A10,1,FALSE),1,0) to test but I always get
the #VALUE error.

Sheet2!B2 is the word to test
Sheet1!A1:A10 is the array



"Pete_UK" wrote in message
ups.com...
You can use MATCH( ) or VLOOKUP( ) to search for text in a column.
Something like:

=IF(MATCH(Sheet1!B2,A1:A10,0),Run Numeric Statement,0)

might give you what you want, but I don't understand what you mean by
"Run Numeric Statement". If the word in Sheet1!B2 does not appear in
the range A1:A10, you will get the #N/A error message.

Hope this helps.

Pete