Solved

Autofilling an array - excel

Posted on 2011-09-19
4
222 Views
Last Modified: 2012-05-12
Hi,
I'm looking for some help to produce an excel sheet that auto-fills out a table of contents depending on what i select in a data sheet.

My example is a list of fruit, I want to be able to choose which fruit I want in the data section, and have it auto-fill in the same order under contents with no spaces for the missing fields.

experts-autoarray.xlsx

Thanks!
0
Comment
Question by:WTC_Services
  • 2
4 Comments
 
LVL 50

Expert Comment

by:teylyn
Comment Utility
Hello,

You can do that if you add a helper column in  the table. Is that an option?

cheers, teylyn
0
 
LVL 50

Accepted Solution

by:
teylyn earned 500 total points
Comment Utility
Put this formula in C4 and copy down

=IF(B4="yes",ROW(A1),"")

Then use this in F3 and copy down as far as you like

=IFERROR(INDEX($A$4:$A$8,SMALL($C$4:$C$8,ROW(A1))),"")

You can hide column C.

See attached

cheers, teylyn
experts-autoarray.xlsx
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
You can also do this without a helper column if you want - the resulting formula is a little longer than teylyn's suggestion. In F3

=IFERROR(INDEX(A$4:A$100,SMALL(IF(B$4:B$100="Yes",ROW(B$4:B$100)-ROW(B$4)+1),ROWS(F$3:F3))),"")

confirmed with CTRL+SHIFT+ENTER and copied down the column - when you run out of entries you get blanks, see attached

regards, barry
27316564.xlsx
0
 

Author Closing Comment

by:WTC_Services
Comment Utility
Thanks teylyn,

this worked great!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now