Retrieving data where it meets criteria in another column

amberdk

New Member
Joined
Sep 22, 2017
Messages
5
I need to make a list of all values where in Column A that meet certain criteria in Column B. Ultimately so that I can do a Vlookup. For example:




Last NameCollections FirmColumn C
HarrisonFirm A
MitchellFirm B
WardFirm A
JohnsonFirm C
JenkinsFirm C
KrugerFirm C
SmithFirm B
RogersFirm A
JaegerFirm B

<tbody>
</tbody>


In column C, I need to create a list that would retrieve everything that is with Firm C. So in this case, column C would be filled with Johnson, Jenkins, Kruger.

I have tried a pivot table, but the problem is I need it in columns because I am going to end up doing a vlookup off of this, and it is for a template, so the hope would be to drop a report in this each month and cells populate. When I tried the pivot, the vlookup would have to change every month based on the new data, and I have a huge set of data so it would be tedious to go through it and change it. I have Kutools if this helps.

Hopefully I explained it correctly.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
A
B
C
D
E
1
Last Name
Collections Firm
Column C
2
Harrison
Firm A
Johnson
Firm C
3
Mitchell
Firm B
Jenkins
4
Ward
Firm A
Kruger
5
Johnson
Firm C
6
Jenkins
Firm C
7
Kruger
Firm C
8
Smith
Firm B
9
Rogers
Firm A
10
Jaeger
Firm B

<tbody>
</tbody>

In E2 put the firm you are looking up

In C2 and copy down

This is an array formula and must be committed with CONTROL+SHIFT+ENTER. If done correctly Excel will put {} around the formula.
Code:
=IF(ROWS($C$2:C2)>COUNTIF($B$2:$B$10,$E$2),"",INDEX($A$2:$A$10,SMALL(IF($B$2:$B$10=$E$2,ROW($B$2:$B$10)-ROW($B$2)+1),ROWS($C$2:C2))))
 
Last edited:
Upvote 0
In response to your PM the formula posted above will return the item in Column A when Column B equals what is in E2. To look up Firm A just type Firm A into E2. If you will not be changing the firm then you can hardcode it into the formula.
 
Upvote 0
In response to your PM the formula posted above will return the item in Column A when Column B equals what is in E2. To look up Firm A just type Firm A into E2. If you will not be changing the firm then you can hardcode it into the formula.


Ahh, I see whats going on. I cannot see the formula, which explains my confusion. The code box is not allowing me to scroll to find the formula you are giving.
 
Upvote 0
Last NameCollections FirmFirm C
HarrisonFirm A3
MitchellFirm BName List
WardFirm AJohnson
JohnsonFirm CJenkins
JenkinsFirm CKruger
KrugerFirm C
SmithFirm B
RogersFirm A
JaegerFirm B

<tbody>
</tbody>

C1 houses a firm of interest.

In C2 just enter:

=COUNTIFS($B$2:$B$10,C$1)

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

=IF(ROWS(C$4:C4)>C$2,"",INDEX($A$2:$A$10,SMALL(IF($B$2:$B$10=C$1,ROW($A$2:$A$10)-ROW($A$2)+1),ROWS(C$4:C4))))

This set up should be a tad faster.
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,942
Members
449,275
Latest member
jacob_mcbride

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