Index Match along with SMALL and COUNTIF

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,395
Hello Guys,
I got a three formulae that return results from another worksheet. One of these is working alright - the one that returns the dates. But the two other are not working. I am posting a portion here. Any help is appreciated and THANKS in advance.
Excel Workbook
ABCD
1LAST NAMEFIRST NAMEDC Exp date31/12/2012
2
3#NUM!#NUM!10/07/2008
4#NUM!#NUM!10/07/2008
5#NUM!#NUM!10/07/2008
DC
 

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,395
OK
I will post another sample where another formula is working but it is giving me the same result for same date in three different cells. I would like to get three right results which will be different person name in all three cases.
Excel Workbook
ABCDEF
1LAST NAMEFIRST NAMEDC Exp date31/12/2012
2#NUM!#NUM!26/03/2008BOGDANOVIC
3#NUM!#NUM!10/07/2008SIPILIANO
4
5#NUM!#NUM!10/07/2008SIPILIANO
DC
 

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,395
I worked it out myself, so no need of any solutions now. Thanks anyway to anyone who may have tried to solve it for me.
 

T. Valko

Well-known Member
Joined
May 9, 2009
Messages
16,623
I worked it out myself, so no need of any solutions now. Thanks anyway to anyone who may have tried to solve it for me.
OK, glad you got it worked out. Here's a tip that'll save you a few keystrokes when dealing with complex formulas like those:

=IF(ISERROR(INDEX(Details!$C$2:$R$40,MATCH($C4,Details!R$2:R$40,0),3)),"",SMALL(INDEX(Details!$C$2:$R$40,MATCH($C4,Details!R$2:R$40,0),3),COUNTIF(C$2:C4,C4)))

When error trapping, the portion of the formula that will actually cause an error is the MATCH function so you can leave out the INDEX portion:

=IF(ISERROR(MATCH($C4,Details!R$2:R$40,0)),"",SMALL(INDEX(Details!$C$2:$R$40,MATCH($C4,Details!R$2:R$40,0),3),COUNTIF(C$2:C4,C4)))

Or, since the MATCH function generates an #N/A error:

=IF(ISNA(MATCH($C4,Details!R$2:R$40,0)),"",SMALL(INDEX(Details!$C$2:$R$40,MATCH($C4,Details!R$2:R$40,0),3),COUNTIF(C$2:C4,C4)))

Or,

=IF(COUNTIF(Details!R$2:R$40,$C4),SMALL(INDEX(Details!$C$2:$R$40,MATCH($C4,Details!R$2:R$40,0),3),COUNTIF(C$2:C4,C4)),"")
 

asad

Well-known Member
Joined
Sep 9, 2008
Messages
1,395
Thanks #NAME for your tips. I will try to memorise them for my other formulae as well. Thanks again :)
 

Forum statistics

Threads
1,082,109
Messages
5,363,193
Members
400,721
Latest member
eileen123

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top