How to Pull ALL matching values from a list/array

SirGruffles

New Member
Joined
Jul 23, 2018
Messages
26
Hello,

I have a list of account numbers in the format of "XXXX-YYY-ZZZ- -" in column A, specifically A6-A684.

Is there a function in excel, similar to Vlookup, that would pull out any and all account numbers that match a certain criteria?

For instance, ideally, I would want to pull out any and all account numbers that end in "100-100- -", and I figured that (including the extra dashes), would require the use of Right(data,10) as the matching criteria. Or something with an If statement to have that match the 100-100- -? Blargh, brain hurt.

But after that, I get completely stumped as to how I can make it scroll through the entire list and give me ALL the matching accounts, and not simply the first one it finds in the list.

Thank you very much for any and all help on this.

(I'm at a new job and would like to look knowledgeable >.>)

Thanks!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Would filtering get what you want?
If you need this sub-set of your data to be in a different location, you could look at Advanced Filter and its Copy To Other Location option.
Otherwise, VBA would be needed.
 
Upvote 0
Yeah, its a bit more manual than I was hoping for.
As to get the reports to my superiors quicker, I did the manual filtering and made 35 different tabs for the cost centers.

I just thought there may have been a formula or something more automated that would have made the process quicker and more efficient.
I thought something like Match or Index? could have helped?
No idea.

I just recently got pivot tables down, so these crazier shenanigans have me brain dead.
 
Upvote 0
See if this example helps


A
B
C
D
1
Account​
Criteria​
List​
2
0001-100-100- -​
100-100- -​
0001-100-100- -​
3
0002-100-101- -​
0003-100-100- -​
4
0003-100-100- -​
0004-100-100- -​
5
0004-100-100- -​
0006-100-100- -​
6
0005-100-102- -​
7
0006-100-100- -​
8

Criteria in C2

Array formula in D2 copied down
=IFERROR(INDEX(A$2:A$7,SMALL(IF(RIGHT(A$2:A$7,10)=C$2,ROW(A$2:A$7)-ROW(A$2)+1),ROWS(D$2:D2))),"")
confirmed with Ctrl+Shift+Enter, not just Enter

Adjust the ranges to suit

M.
 
Upvote 0
Out of curiosity, if there was a requirement of 2 criteria, for a single column, would there be a way to insert both criteria into that one formula?
For instance, this one report would be for centers ending in 110-200 and 110-250.
 
Upvote 0
Out of curiosity, if there was a requirement of 2 criteria, for a single column, would there be a way to insert both criteria into that one formula?
For instance, this one report would be for centers ending in 110-200 and 110-250.

Maybe something like this


A
B
C
D
1
Account​
CriteriaList​
Result​
2
0001-100-100- -​
110-200- -​
0002-110-200- -​
3
0002-110-200- -​
110-250- -​
0004-110-250- -​
4
0003-100-100- -​
0005-110-200- -​
5
0004-110-250- -​
6
0005-110-200- -​
7
0006-100-100- -​

Array formula in D2 copied down
=IFERROR(INDEX(A$2:A$7,SMALL(IF(ISNUMBER(MATCH(RIGHT(A$2:A$7,10),C$2:C$3,0)),ROW(A$2:A$7)-ROW(A$2)+1),ROWS(D$2:D2))),"")
Ctrl+Shift+Enter

M.
 
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

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