array needed

tbablue

Active Member
Joined
Apr 29, 2007
Messages
482
Office Version
  1. 365
Platform
  1. Windows
2 columns are populated in Sheet 1 - column E contains a list of numbers & column M a list of names.

Sheet 2 $A$1 is a validated drop-down list of names drawn from column M Sheet 1.

I need an array that populates column C of Sheet 2 with all numbers that correspond to the value in $A$1

Can anyone help me with this please? It's driving me crazy.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
On Sheet2, try...

B2:

=COUNTIF(Sheet1!M2:M10,A1)

C2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=IF(ROWS(C$2:C2)<=$B$2,INDEX(Sheet1!$E$2:$E$10,SMALL(IF(Sheet1!$M$2:$M$10=$A$1,ROW(Sheet1!$M$2:$M$10)-ROW(Sheet1!$M$2)+1),ROWS(C$2:C2))),"")

If you want the numbers sorted and returned in ascending order, try the following instead...

C2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=IF(ROWS(C$2:C2)<=$B$2,SMALL(IF(Sheet1!$M$2:$M$10=$A$1,Sheet1!$E$2:$E$10),ROWS(C$2:C2)),"")

Adjust the ranges, accordingly.

Hope this helps!

xl-central.com
 
Upvote 0
Thank you Domenic. Seems to do just what's required.

Appreciated. :)
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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