# if with 2 condition

#### Salamullah

##### Board Regular
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","")

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

#### Twollaston

##### Board Regular
=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

Last edited:

#### jtakw

##### Well-known Member
Hi,

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

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

• Twollaston

#### DanteAmor

##### Well-known Member
You can also use this way:

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

Thanks all

You're welcome.