Problem with comparison

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a set of values in a column. The user needs to enter a value in a cell and if it matches any value in the range, then the value should be "a" or it should be blank
Suppose Range A1:A4 have values abc,def,ghi,jk
The user enters a value in Cell B5. Based upon the value, the value in Cell C5 should be 'a' or empt
the formula in cell C5 is =IF(OR(B5=A1,A2,A3,A4),"a",""
The problem is that if I enter abc, only then the value in C5 is turning into 'a'. Even if I enter def,ghi or jki it treats the condition as false
What is the reason for this beahviour
Please hel
Thank
Shilps
 
Hi
try
=IF(COUNTIF(A1:A4,B5),"a","")
-----Original Message-----
Hi,

I have a set of values in a column. The user needs to
enter a value in a cell and if it matches any value in the
range, then the value should be "a" or it should be blank.
Suppose Range A1:A4 have values abc,def,ghi,jkl
The user enters a value in Cell B5. Based upon the value,
the value in Cell C5 should be 'a' or empty
the formula in cell C5 is =IF(OR(B5=A1,A2,A3,A4),"a","")
The problem is that if I enter abc, only then the value
in C5 is turning into 'a'. Even if I enter def,ghi or jki
it treats the condition as false.
 
Back
Top