View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
FloridaHockeyGuy FloridaHockeyGuy is offline
external usenet poster
 
Posts: 4
Default Countif Problem (or suggestion for alternative)

I am using Countif to see if a value (in this case, the value in cell A2) is
present in a column (A) of data;
=COUNTIF('[Products.xlsm]Sheet1'!$A:$A,A2)

but the problem is that the column is full of numbers, or combinations of
numbers and text, as they are item numbers. The column is formatted as text
due to this, as well as some item numbers has a preceding 0. For example,
there will item 123 and also an item 0123.

I am using this Countif in a column in one spreadsheet to look up the values
in another, and depending on whether the answer is 0 or 1, my next column is
a VLookup function that gets the value from the next column (if the Countif
<0), or else if puts an alternate value.

Here is the problem. If A2 = 123, and if the column does NOT have 123, but
it DOES have 0123, the result is returned as 1. Of course, then my lookup
returns an N/A since it looks for 123 and it is not in the list.

Is there any way I can do use Countif to only find EXACT matches, or would
somebody have a suggestion on how to get around this.

I thank you greatly in advance for your responses.
--
BB