Extracting a List of Values Filtered by Criteria with Sub-Arrays

elcommissioner

New Member
Joined
Aug 18, 2017
Messages
2
Hi guys,

This is my first post on this forum so sorry if it's not clear but I'm hoping for some help with a formula.

I'm trying to design a formula that will present people with a list of holiday destinations based upon when they'd like to go. On the sheet 'Countries' there's data with each country listed as a separate row for every month that it's good to visit there, like so:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Country[/TD]
[TD]Continent[/TD]
[TD]Safe?[/TD]
[TD]Lang[/TD]
[TD]Cur[/TD]
[TD]Cost1[/TD]
[TD]Cost2[/TD]
[TD]Cost3[/TD]
[TD]Go[/TD]
[TD]Avoid[/TD]
[/TR]
[TR]
[TD]Angola[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 368"]
<tbody>[TR]
[TD]September[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Benin[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 368"]
<tbody>[TR]
[TD]January[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Benin[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 368"]
<tbody>[TR]
[TD]February[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Botswana[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 368"]
<tbody>[TR]
[TD]April[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Botswana[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 368"]
<tbody>[TR]
[TD]May[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Botswana[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 368"]
<tbody>[TR]
[TD]June[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Botswana[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 368"]
<tbody>[TR]
[TD]July[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Botswana[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 368"]
<tbody>[TR]
[TD]August[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Burkina Faso[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]November[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

On a separate sheet 'Questions', I have a question with a drop-down list of months the person would like to travel then below a copy of the table template with the following formula pasted into the cells to generate a list based on the person's answer to the question 'When would you like to travel?':

Code:
IFERROR
(INDEX
('Master Sheet - Countries'!A$3:A$428,
SMALL
(IF
('Master Sheet - Countries'!$I$3:$I$428=Questions!$D$3,
ROW
('Master Sheet - Countries'!A$3:A$428)-
ROW
('Master Sheet - Countries'!A$3)+1),
ROWS
('Master Sheet - Countries'!A$3:'Master Sheet - Countries'!A3))),"")

The result is not an error message but in spite of the formula being posted to every row in the table, it only completes the first line of the empty table, usually with the wrong answer.

I constructed the formula based on something I found online but I don't have the expertise to identify where I have gone wrong.

Any help would be greatly appreciated. I'm running Excel version 15.31 for mac.

regards,

Elcommissioner
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Would you post the output that you want which goes with the input you show? (A non-working formula does not help much; on the contrary, it can be a hindrance.)
 
Upvote 0
Thanks for responding.

For example, I would want the following:

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]When would you like to go?[/TD]
[TD]September[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Country[/TD]
[TD]Continent[/TD]
[TD]Safe?[/TD]
[TD]Lang[/TD]
[TD]Cur[/TD]
[TD]Cost1[/TD]
[TD]Cost2[/TD]
[TD]Cost3[/TD]
[TD]Go[/TD]
[/TR]
[TR]
[TD]Angola[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]September[/TD]
[/TR]
[TR]
[TD]Burundi[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]September[/TD]
[/TR]
[TR]
[TD]Cabo Verde[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]September[/TD]
[/TR]
[TR]
[TD]Equitorial Guinea[/TD]
[TD]Africa[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]September[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Let me know if you require more information.

Regards,
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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