Second search criteria

Pat1009

Active Member
Joined
Jun 4, 2015
Messages
264
Hello board,
I have this formula....

Code:
=COUNTIFS('Assets Open'!$N:$N,">="&W3 -6,'Assets Open'!$N:$N,"<="&W3 +1,'Assets Open'!$K:$K,"john*smith")

It works great. But I want to add another criteria in the same column K:K
So it will search for a blank cell in addition to john smith.... count them both together.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Re: Need help with a second search criteria

=COUNTIFS('Assets Open'!$N:$N,">="&W3 -6,'Assets Open'!$N:$N,"<="&W3 +1,'Assets Open'!$K:$K,{"john*smith","bob Smith"})

does that work? replace bob smith as see fit hard to replcate without knowing what is in the other fields

Or

<code>=SUM(COUNTIFS(</code><code>'Assets Open'!$N:$N,">="&W3 -6,</code><code>'Assets Open'!$N:$N,"<="&W3 +1,</code><code>'Assets Open'!$K:$K,,{</code><code>"john*smith","stringB","stringC"}))</code>
 
Last edited:
Upvote 0
Re: Need help with a second search criteria

The top one look like it could work, but instead of bob smith, I need it to find all blank cells with something in the cell next to it. left or right of the blank cell
 
Upvote 0
Re: Need help with a second search criteria

You lost me can you show a sample of data? and all columns so I can understand

one of the more knowledgeable might know better than me im no expert

Are you saying you want to see John Smith in K and blanks in K
 
Last edited:
Upvote 0
Re: Need help with a second search criteria

yes, that is what I am saying.
but when it looks for the blanks, the blanks must have some/any data to the left or right cell.
the reason is I don't want it to find blanks cells all the way to the bottom of the spreadsheet. just the blanks with data in the cell next to the blank.
 
Upvote 0
Re: Need help with a second search criteria

So you do not need the John smith part only to match if K is K is blank and J or L are not blank.

Sorry I dont get what you are saying

Surely one column will always have some data in it and therfore you use that to stop it going thousands of rows
 
Last edited:
Upvote 0
Re: Need help with a second search criteria

This one looks like it would work with 1 change....
=COUNTIFS('Assets Open'!$N:$N,">="&W3 -6,'Assets Open'!$N:$N,"<="&W3 +1,'Assets Open'!$K:$K,{"john*smith","BLANK CELL"})
The stuff in red is what needs to be changed. I want it to look for all the john smith and all the blank cells and count them all.
 
Last edited:
Upvote 0
Re: Need help with a second search criteria

Is this what you are after?

=SUM(COUNTIFS('Assets Open'!$N:$N,">="&W3 -6,'Assets Open'!$N:$N,"<="&W3 +1,'Assets Open'!$K:$K,{"john*smith",""}))
 
Upvote 0
Re: Need help with a second search criteria

that helped a lot, but for some reason it is counting 28 when there are only 26, I will have to find out why.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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