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","")
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
=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:
Upvote 0
Hi,

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

=IF(OR(A1="501000",A1="511000"),"Good","")
 
Upvote 0
You can also use this way:



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

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top