counting cells containing specific text

ceds

New Member
Joined
Jul 30, 2010
Messages
27
Hi,

I am trying to write a formula so that if three cells contain specific text, a number one will be put in a certain column.

For example:
Cell A1 contains an A
Cell B1 contains a B
Cell C1 contains a B

What formula would I need so that if this pattern exists a number 1 would appear in cell E1 for example?

Many thanks if you can help!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I'd like to think there's a more elegant way (probably using array formula) but this appears to do the job:

=--AND(NOT(ISERROR(FIND("A",A1))),NOT(ISERROR(FIND("B",B1))),NOT(ISERROR(FIND("B",C1))))

If there's a match you get a 1, if all 3 conditions are not met, a zero is returned.

HTH
 
Upvote 0
Hi ceds, welcome to the board.
I doubt your example is as simple as the real desire, but how about this to start? (In E1)
Code:
=(A1="A")*(B1="B")*(C1="B")
This will return a 1 in E1 if all are true, or a zero if all are not.

That help at all?
 
Upvote 0
That's great, thanks both of you - both solutions will definitely help with what I'm looking to do.

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,591
Members
449,089
Latest member
Motoracer88

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