extracting a list with 2 criteria

raccoon588

Board Regular
Joined
Aug 5, 2016
Messages
118
i am trying to add another criteria to this formula so that once i copy the formula down it will generate a list. it works with one criteria but i need it to use two.
=IFERROR(INDEX($A:$A,SMALL(IF($D:$D=O$3,ROW($D:$D)-ROW($D$1)+1),ROWS($D$1:$D1))),"")

how would i go about adding the second criteria to the above formula?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
if you still havent found the solution, can you post like 10 rows of sample data, and pls specify what your criteria should be.
 
Upvote 0
i am trying to add another criteria to this formula so that once i copy the formula down it will generate a list. it works with one criteria but i need it to use two.
=IFERROR(INDEX($A:$A,SMALL(IF($D:$D=O$3,ROW($D:$D)-ROW($D$1)+1),ROWS($D$1:$D1))),"")

how would i go about adding the second criteria to the above formula?

Try to avoid referencing whole columns for reasons of efficiency.

Assuming that the data start at row 2 and the second criteria is in O2 which column C is supposed to be equal to...

In O1 enter:

=COUNTIFS(C2:C4000,O2,D2:D4000,O3)

In O5 control+shift+enter, not just enter, and copy down:

=IF(ROWS(O$5:O5)>O$1,"",INDEX(A$2:A$4000,SMALL(IF($C$2:$C$4000=O$2,IF($D$2:$D$4000=O$3,ROW(A$2:A$400)-ROW(A$2)+1)),ROWS(O$5:O5))))

This should create a sublist based on two criteria in O5 downwards.
 
Upvote 0
Id like to pull all the name (just the names) that are both in Dept 205 and Position Lamp maker using a formula. here is some data.

[TABLE="width: 647"]
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Name[/TD]
[TD]Dept[/TD]
[TD]Shift[/TD]
[TD]Area[/TD]
[TD]Position[/TD]
[TD]Badge Number[/TD]
[TD]Hire Date[/TD]
[/TR]
[TR]
[TD]Bezio, Wanda[/TD]
[TD]372[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]10718[/TD]
[TD]November 26, 1984[/TD]
[/TR]
[TR]
[TD]Boston, Nick[/TD]
[TD]205[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15830[/TD]
[TD]August 8, 2016[/TD]
[/TR]
[TR]
[TD]Burgess, Ross[/TD]
[TD]351[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]77055[/TD]
[TD]January 15, 2018[/TD]
[/TR]
[TR]
[TD]Chase, Brittany[/TD]
[TD]205[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15801[/TD]
[TD]January 18, 2016[/TD]
[/TR]
[TR]
[TD]Collelo, Alex[/TD]
[TD]372[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]77059[/TD]
[TD]January 29, 2018[/TD]
[/TR]
[TR]
[TD]Ervin, Lorelei[/TD]
[TD]372[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15781[/TD]
[TD]August 3, 2015[/TD]
[/TR]
[TR]
[TD]Furlong, Ross[/TD]
[TD]301[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Mechanic[/TD]
[TD]15477[/TD]
[TD]May 22, 2000[/TD]
[/TR]
[TR]
[TD]Gerini, Josh[/TD]
[TD]351[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15746[/TD]
[TD]May 19, 2014[/TD]
[/TR]
[TR]
[TD]Goudreault, Tammy[/TD]
[TD]372[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15761[/TD]
[TD]January 19, 2015[/TD]
[/TR]
[TR]
[TD]Kelley, Lia[/TD]
[TD]372[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15795[/TD]
[TD]November 23, 2015[/TD]
[/TR]
[TR]
[TD]Lawson, Heather[/TD]
[TD]351[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15778[/TD]
[TD]July 27, 2015[/TD]
[/TR]
[TR]
[TD]Mackey, LeeAnn[/TD]
[TD]301[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15548[/TD]
[TD]January 2, 2001[/TD]
[/TR]
[TR]
[TD]McLemore, Sandy[/TD]
[TD]201[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15029[/TD]
[TD]May 17, 1993[/TD]
[/TR]
[TR]
[TD]Mitchell, Robyn[/TD]
[TD]102[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Material Handler[/TD]
[TD]15357[/TD]
[TD]August 30, 1999[/TD]
[/TR]
[TR]
[TD]Moy, Jennifer[/TD]
[TD]301[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15789[/TD]
[TD]November 2, 2015[/TD]
[/TR]
[TR]
[TD]Ouellette, Courtney[/TD]
[TD]205[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]77015[/TD]
[TD]July 10, 2017[/TD]
[/TR]
[TR]
[TD]Pelchat, Linda[/TD]
[TD]102[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker\GL[/TD]
[TD]15794[/TD]
[TD]November 23, 2015[/TD]
[/TR]
[TR]
[TD]Pelchat, Randy[/TD]
[TD]205[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Mechanic[/TD]
[TD]15507[/TD]
[TD]September 5, 2000[/TD]
[/TR]
[TR]
[TD]Richards, Tina[/TD]
[TD]372[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]15737[/TD]
[TD]March 3, 2014[/TD]
[/TR]
[TR]
[TD]Rockwell, Tyler[/TD]
[TD]205[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]77050[/TD]
[TD]December 11, 2017[/TD]
[/TR]
[TR]
[TD]Roth, Jen[/TD]
[TD]301[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker[/TD]
[TD]11024[/TD]
[TD]February 3, 1986[/TD]
[/TR]
[TR]
[TD]Traxler, Kimberly[/TD]
[TD]372[/TD]
[TD]1[/TD]
[TD]SSL[/TD]
[TD]Lamp Maker\GL[/TD]
[TD]76957[/TD]
[TD]February 20, 2017[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Excel 2016 (Windows) 32 bit
ABCDEFGHI
1NameDeptShiftAreaPositionBadge NumberHire Date
2Bezio, Wanda3721SSLLamp Maker1071826-Nov-84Boston, Nick
3Boston, Nick2051SSLLamp Maker158308-Aug-16Chase, Brittany
4Burgess, Ross3511SSLLamp Maker7705515-Jan-18Ouellette, Courtney
5Chase, Brittany2051SSLLamp Maker1580118-Jan-16Rockwell, Tyler
6Collelo, Alex3721SSLLamp Maker7705929-Jan-18
7Ervin, Lorelei3721SSLLamp Maker157813-Aug-15
8Furlong, Ross3011SSLMechanic1547722-May-00
9Gerini, Josh3511SSLLamp Maker1574619-May-14
10Goudreault, Tammy3721SSLLamp Maker1576119-Jan-15
11Kelley, Lia3721SSLLamp Maker1579523-Nov-15
12Lawson, Heather3511SSLLamp Maker1577827-Jul-15
13Mackey, LeeAnn3011SSLLamp Maker155482-Jan-01
14McLemore, Sandy2011SSLLamp Maker1502917-May-93
15Mitchell, Robyn1021SSLMaterial Handler1535730-Aug-99
16Moy, Jennifer3011SSLLamp Maker157892-Nov-15
17Ouellette, Courtney2051SSLLamp Maker7701510-Jul-17
18Pelchat, Linda1021SSLLamp Maker\GL1579423-Nov-15
19Pelchat, Randy2051SSLMechanic155075-Sep-00
20Richards, Tina3721SSLLamp Maker157373-Mar-14
21Rockwell, Tyler2051SSLLamp Maker7705011-Dec-17
22Roth, Jen3011SSLLamp Maker110243-Feb-86
23Traxler, Kimberly3721SSLLamp Maker\GL7695720-Feb-17
Sheet4
Cell Formulas
RangeFormula
I2{=IFERROR(INDEX($A$2:$A$23,SMALL(IF(($B$2:$B$23=205)*($E$2:$E$23="Lamp Maker"),ROW($A$2:$A$23)-ROW($A$2)+1),ROWS($I$2:I2))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0

Excel 2016 (Windows) 32 bit
ABCDEFGHI
1NameDeptShiftAreaPositionBadge NumberHire Date
2Bezio, Wanda3721SSLLamp Maker1071826-Nov-84Boston, Nick
3Boston, Nick2051SSLLamp Maker158308-Aug-16Chase, Brittany
4Burgess, Ross3511SSLLamp Maker7705515-Jan-18Ouellette, Courtney
5Chase, Brittany2051SSLLamp Maker1580118-Jan-16Rockwell, Tyler
6Collelo, Alex3721SSLLamp Maker7705929-Jan-18
7Ervin, Lorelei3721SSLLamp Maker157813-Aug-15
8Furlong, Ross3011SSLMechanic1547722-May-00
9Gerini, Josh3511SSLLamp Maker1574619-May-14
10Goudreault, Tammy3721SSLLamp Maker1576119-Jan-15
11Kelley, Lia3721SSLLamp Maker1579523-Nov-15
12Lawson, Heather3511SSLLamp Maker1577827-Jul-15
13Mackey, LeeAnn3011SSLLamp Maker155482-Jan-01
14McLemore, Sandy2011SSLLamp Maker1502917-May-93
15Mitchell, Robyn1021SSLMaterial Handler1535730-Aug-99
16Moy, Jennifer3011SSLLamp Maker157892-Nov-15
17Ouellette, Courtney2051SSLLamp Maker7701510-Jul-17
18Pelchat, Linda1021SSLLamp Maker\GL1579423-Nov-15
19Pelchat, Randy2051SSLMechanic155075-Sep-00
20Richards, Tina3721SSLLamp Maker157373-Mar-14
21Rockwell, Tyler2051SSLLamp Maker7705011-Dec-17
22Roth, Jen3011SSLLamp Maker110243-Feb-86
23Traxler, Kimberly3721SSLLamp Maker\GL7695720-Feb-17
Sheet4
Cell Formulas
RangeFormula
I2{=IF(ROWS($I$2:I2)<=SUM(IF(($B$2:$B$23=205)*($E$2:$E$23="Lamp Maker"),1)),INDEX($A$2:$A$23,SMALL(IF(($B$2:$B$23=205)*($E$2:$E$23="Lamp Maker"),ROW($A$2:$A$23)-ROW($A$2)+1),ROWS($I$2:I2))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.


I think this one is faster if u have a lot of data
 
Last edited:
Upvote 0
Just adjust any formula's refrences to the size of your data, and drag down your formula as much as u want...
 
Upvote 0
Id like to pull all the name (just the names) that are both in Dept 205 and Position Lamp maker using a formula. here is some data.

[...]

Just substitute the conditions and adjust the condition ranges in the formulas you are already given...

O1 >> just enter

=COUNTIFS(B2:B4000,O2,E2:E4000,O3)

O2 : 205 [the department condition for column B]

O3 : Lamp Maker [the Position condition for column E]

O5 >> control+shift+enter, not just enter, and copy down:

=IF(ROWS(O$5:O5)>O$1,"",INDEX(A$2:A$4000,SMALL(IF($B$2:$B$4000=O$2,IF($E$2:$E$4000=O$3,ROW(A$2:A$400)-ROW(A$2)+1)),ROWS(O$5:O5))))
 
Upvote 0
Just substitute the conditions and adjust the condition ranges in the formulas you are already given...

O1 >> just enter

=COUNTIFS(B2:B4000,O2,E2:E4000,O3)

O2 : 205 [the department condition for column B]

O3 : Lamp Maker [the Position condition for column E]

O5 >> control+shift+enter, not just enter, and copy down:

=IF(ROWS(O$5:O5)>O$1,"",INDEX(A$2:A$4000,SMALL(IF($B$2:$B$4000=O$2,IF($E$2:$E$4000=O$3,ROW(A$2:A$400)-ROW(A$2)+1)),ROWS(O$5:O5))))

Yes, that way you can change the criteria.
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,627
Members
452,661
Latest member
Nonhle

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