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!
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Weaver

Well-known Member
Joined
Sep 10, 2008
Messages
5,196
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
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
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?
 

ceds

New Member
Joined
Jul 30, 2010
Messages
27
That's great, thanks both of you - both solutions will definitely help with what I'm looking to do.

Thanks again!
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,603
Messages
5,512,353
Members
408,887
Latest member
KPH Akron

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top