Two search conditions in an array formula.

saracz66

New Member
Joined
Jan 23, 2012
Messages
16
I am using the following array formula to count the occurrances of a unique string:

{=SUM(IF(ISNUMBER(FIND("search string",Data!B:B,1)),1,0))}

My worksheet contains the following sample data:

ColA ColB
Yes this is the search item
Yes this is also the search string
Yes this is another search string
No this is a 4th search string

My formula above renders a count of 3, since "search string" is in column B on three of the four rows.

I would like to expand the formula to include an additional requirement where "Yes" is also found in column A. So after the formula modification, I would expect to get a count of 2 since "Yes" is on only two of the three rows containing "search string".
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Just figured it out on my own! Simply add another IF condition. For example:

=SUM(IF(ISNUMBER(FIND("search string",Data!B:B,1)),IF(ISNUMBER(FIND("Yes",Data!A:A,1)),1,0),0))
 
Upvote 0

Forum statistics

Threads
1,217,973
Messages
6,139,704
Members
450,226
Latest member
DrKraGeN

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