Countif with two text (string) criteria

Hollywoood

Board Regular
Joined
Aug 11, 2011
Messages
53
Hi all, I am sure this is very simple but I just do not seem to be returning the correct result. I am trying to count the occurences with two separate and independent strings of text both exist in a worksheet.

I have been trying variations of the following with no success

IF(A2<>"",COUNTIF('Sheet1'!M:M,AND("*"&A2&"*","*"&"STRING TWO"&"*")),"")

In english my intent is to look at column M:M of Sheet1 and count the instances, where A2 is non non null, the text in cell A2 as well as the specified text for string 2 both exist in a given cell. I believe my problem is in the underlined area. I have a similar formula that works perfect without the AND clause and second string ie) =IF(A2<>"",COUNTIF('Sheet1'!M:M,"*"&A2&"*"),"")

As always thanks for your time and help
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,225,151
Messages
6,183,197
Members
453,151
Latest member
Lizamaison

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