# Return dates that match a single criteria (a countif criteria)

1. ## Return dates that match a single criteria (a countif criteria)

I have a football listing of players in Col A and dates on rows along the top. Each player has to assign a Y or a N on their named row to suggest whether or not they are able to attend that day.
Currently I have a macro (courtesy of John Davis) that returns the dates that everyone can do. I want to amend this macro slightly though on the basis that if not everybody can attend (ie at least one person says N) then the macro will return the dates where the majority of people can come, and return the names of the players that are missing.

See attachment for what I have so far (B17:C19 are my expected results. If you change anything in the Y and N ranges these expected results will be cleared, just so you know.)

2. ## Re: Return dates that match a single criteria (a countif criteria)

nickmax1,

Add this macro to your workbook and run. Hopefully this should do the trick if I have understood you correctly.

``Please Login or Register  to view this content.``
Thanks

Stu

3. ## Re: Return dates that match a single criteria (a countif criteria)

Stuart,
Thanks for responding so fast!
Its not quite what i was after though. What yours does (brilliantly though) is take all the dates and names of players that cant make it and lists them one after the other (though not in order strangely?)

What I was hoping for was that of my list of dates the macro would use some sort of countif formula to identify the dates (or date) that has the least amount of N's and return just those dates along with the players names who would not be present.
So for example if there were three days where only two players were not present the result would be:

Wednesday 15/2/2014 Tom L,Stuart D
Monday 1/3/2014 Nick C, Bob W

4. ## Re: Return dates that match a single criteria (a countif criteria)

is this not possible?

5. ## Re: Return dates that match a single criteria (a countif criteria)

I have updated the sheet with a countif formula and a conditional format to identify the colomns with the least amount of Ns. I was hoping someone clever enough could write code that could identify those colomns and return the days and dates beneath them (highlighted in red in the attached)

6. ## Re: Return dates that match a single criteria (a countif criteria)

come on guys you are all a smart bunch!

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1