# Thread: if with 2 condition Thanks:  1 Post #5291178 (1) Likes: 0

1. ## if with 2 condition

I have many account numbers in column A but if account 501000 & 511000 comes then text required in Cell B1 is "Good" else blank.

I only know formula as follows, how to add 511000 also in the formula ?

=If(\$A\$1:\$A\$1000="501000","Good","")

2. ## Re: if with 2 condition

=If(or(A1 ="501000",A1= "511000","Good",""))
Paste into row 1 and drag it down

Please note if 501000 are formatted as numbers then you should set them like this A1 = 501000 without the quotations, the formula with "501000" or "511000" will only work if they are text formatted

3. ## Re: if with 2 condition

Hi,

Formula suggested in Post # 2 has a misplaced bracket, should be:

=IF(OR(A1="501000",A1="511000"),"Good","")

4. ## Re: if with 2 condition

You can also use this way:

=IF(OR(A1={"501000","511000"}),"Good","")

Thanks all

6. ## Re: if with 2 condition

You're welcome.

7. ## Re: if with 2 condition

Originally Posted by Salamullah
Thanks all