Pull values from an array that satisfy criteria

ptridimas

New Member
Joined
Feb 20, 2014
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hallo everyone

In the table below there are 2 columns. The fist specifies the year and the second some values. I would like to know whether is a way by using a function to pull all data from column B that concern e,g, year 2018, and show them in a column somewhere else in the sheet.

YearValues
2018Value 01
2018Value 02
2018Value 03
2018Value 04
2018Value 05
2018Value 06
2019Value 07
2019Value 08
2019Value 09
2020Value 10
2020Value 11
2020Value 12
2020Value 13


Thanks in advance
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Paste to C2 and pull down:
Excel Formula:
=INDEX($B$1:$B$100,SMALL(IF($A$1:$A$100=2018,ROW($A$1:$A$100)),ROWS($A$1:$A1)))
This is an array formula. Hitting Enter only is not enough. Press Ctrl+Shift+Enter together after paste.
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Here are two possibilities depending on your Excel version.
H1 needs to be copied down, F1 does not. Neither require Ctrl+Shift+Enter confirmation.

23 01 20.xlsm
ABCDEFGH
1YearValuesYearValue 01Value 01
22018Value 012018Value 02Value 02
32018Value 02Value 03Value 03
42018Value 03Value 04Value 04
52018Value 04Value 05Value 05
62018Value 05Value 06Value 06
72018Value 06 
82019Value 07 
92019Value 08 
102019Value 09 
112020Value 10 
122020Value 11 
132020Value 12 
142020Value 13 
Year Data
Cell Formulas
RangeFormula
F1:F6F1=FILTER(B2:B14,A2:A14=D2,"")
H1:H14H1=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(B$2:B$14)/(A$2:A$14=D$2),ROWS(H$1:H1))),"")
Dynamic array formulas.
 
Upvote 0
Solution
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Here are two possibilities depending on your Excel version.
H1 needs to be copied down, F1 does not. Neither require Ctrl+Shift+Enter confirmation.

23 01 20.xlsm
ABCDEFGH
1YearValuesYearValue 01Value 01
22018Value 012018Value 02Value 02
32018Value 02Value 03Value 03
42018Value 03Value 04Value 04
52018Value 04Value 05Value 05
62018Value 05Value 06Value 06
72018Value 06 
82019Value 07 
92019Value 08 
102019Value 09 
112020Value 10 
122020Value 11 
132020Value 12 
142020Value 13 
Year Data
Cell Formulas
RangeFormula
F1:F6F1=FILTER(B2:B14,A2:A14=D2,"")
H1:H14H1=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(B$2:B$14)/(A$2:A$14=D$2),ROWS(H$1:H1))),"")
Dynamic array formulas.
Thank you very much, the filter function worked perfectly
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
.. and for updating your details. (y)
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,694
Members
449,117
Latest member
Aaagu

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