View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default using a cell as criteria instead of cell contents

Jason,

Try this

=SUMPRODUCT(--(TRIM($A$1:$A$2500)=TRIM(B1)))

Mike

"Jason K" wrote:

I am using the formula =COUNTIF($A$1:$A$2500,B1), but it gives a value of 0.
If I use the contents of B1 (ml12345) it gives how many times it appears,
which is what I want. Is there a way to use the cell name (B1) to give the
value I want? I am trying to see how many times each policy number appears. I
want to autofill down, since I have about 300 different policy numbers.