multi criteria multi result lookup

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
1,745
trying to adapt https://www.get-digital-help.com/match-two-criteria-and-return-multiple-rows-in-excel/ to work for me. my version of the formula is:

=INDEX($AK$7:$AK$15, SMALL(IF(COUNTIF($AG$5,$AJ$7:$AJ$15)*COUNTIF($AG$6,$AJ$7:$AJ$15)*COUNTIF($AG$7,$AJ$7:$AJ$15), ROW($AJ$7:$AL$15)-MIN(ROW($AJ$7:$AL$15))+1), ROW(A7)), COLUMN(A7))

AG552MFD
AG6444B3AJAKAL
AG752MF7444B1John Done10.00#NUM!
8444B1Paul BookA/L
952MFDSam Johnson9.00
10444B1Andrew BlokeA/L
1152MFEric Fan10.00
12444B2Paul Peters8.50
13444B3John Sands11.50
1452MFDGuy Noob9.00
15444B1Old Mate10.00
<colgroup><col width="64" style="width: 48pt;" span="9"> <tbody> </tbody>
I want to list each name for the three codes at left. what am I doing wrong?
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,730
Copy AM7 down.
Excel Workbook
AGAHAIAJAKALAM
552MFD
6444B3
752MF7444B1John Done10Sam Johnson
88444B1Paul BookA/LEric Fan
9952MFDSam Johnson9John Sands
1010444B1Andrew BlokeA/LGuy Noob
111152MFEric Fan10
1212444B2Paul Peters8.5
1313444B3John Sands11.5
141452MFDGuy Noob9
1515444B1Old Mate10
Sheet1
 

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
1,745
so, I had the rows at the end wrong and my countif around the wrong way. why in these formulas does the countif layout differ to the normal coumtif? In this context, the criteria is placed before the range.

the fix above works perfectly; thank you. can it be further tweaked to list only those who did not have hours? for example, say eric fan and john sands had no hours this week. how would I adjust the formula to return only those two names?

I have just tried to add in another countif expression looking for null (blank) hours but it seems to skip the 4th argument, any ideas?
 
Last edited:

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,730
so, I had the rows at the end wrong and my countif around the wrong way. why in these formulas does the countif layout differ to the normal coumtif? In this context, the criteria is placed before the range.

the fix above works perfectly; thank you. can it be further tweaked to list only those who did not have hours? for example, say eric fan and john sands had no hours this week. how would I adjust the formula to return only those two names?

I have just tried to add in another countif expression looking for null (blank) hours but it seems to skip the 4th argument, any ideas?
You are welcome - thanks for the reply. Just FYI, your formula also had the Countif's requiring an AND condition (Countif1*Countif2*Countif3) whereas it should be an OR condition (Countif1+Countif2+Countif3).

As for your new question, assuming that "A/L" in col AL indicates no hours this week, the formula can be adjusted as below.
Excel Workbook
AGAHAIAJAKALAM
552MFD
6444B3
752MF7444B1John Done10Eric Fan
88444B1Paul BookA/LJohn Sands
9952MFDSam Johnson9
1010444B1Andrew BlokeA/L
111152MFEric FanA/L
1212444B2Paul Peters8.5
1313444B3John SandsA/L
141452MFDGuy Noob9
1515444B1Old Mate10
Sheet1
 
  • Like
Reactions: ajm

Watch MrExcel Video

Forum statistics

Threads
1,095,230
Messages
5,443,233
Members
405,219
Latest member
CraneS

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top