if with 2 condition

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
221
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","")
 

Some videos you may like

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
Joined
May 24, 2019
Messages
233
=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
Joined
Jun 29, 2014
Messages
5,146
Hi,

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

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

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
11,926
Office Version
2007
Platform
Windows
You can also use this way:



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

Watch MrExcel Video

Forum statistics

Threads
1,100,061
Messages
5,472,229
Members
406,809
Latest member
haf19

This Week's Hot Topics

Top