Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Autofilling an array - excel

Posted on 2011-09-19
Medium Priority
239 Views
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
Question by:WTC_Services
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 50

Expert Comment

ID: 36564079
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

Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 2000 total points
ID: 36564105
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

ID: 36564141
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

ID: 36564749
Thanks teylyn,

this worked great!
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
###### Suggested Courses
Course of the Month9 days, 9 hours left to enroll