Closed Thread
Results 1 to 4 of 4

Need Help expanding a list....

  1. #1
    Registered User
    Join Date
    05-29-2007
    Posts
    40

    Need Help expanding a list....

    I have a long list of words:
    e.g.:

    apple
    pear
    banana
    peach

    and I want to expand the list to look like this for instance:
    apple
    apple
    apple
    apple
    apple
    pear
    pear
    pear
    pear
    pear
    banana
    banana
    banana
    banana
    banana
    peach
    peach
    peach
    peach
    peach

    Now this may be easy for such a small number of words but my list is over 10,000 long and i need to expand each word about 50 times.... the other problem is that i need to keep them in the order they are in now...i cant use alphabetical sorting (which is where my problem comes in). What is a good formula to use to do this? Thanks

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    If your list is in A1:A10000, then in B1 put the formula:

    =INDIRECT("A"&CEILING(ROW()/5,1))

    Fill this down the entire column of B (since 10000 items in column A would translate to 50000 items in column B if you want 5 of each).

    This should do what you're asking.. I hope.

  3. #3
    Forum Contributor
    Join Date
    07-05-2007
    Location
    Lexington, MA
    Posts
    302

    Fill-Down Formula

    Instead of a macro, here is a quick filled down formula
    Assuming your words are in A1:A10000

    set B1: =OFFSET($A$1,(ROWS($A$1:A1)-1)/5,0)

    Then do a long fill-down (to row 50,000+)

    This gives you 5 result words for each col A word and preserves their order

    I have also attached an example sheet
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-29-2007
    Posts
    40

    perfect

    That is exactly what i needed! Man I dont know how much time I would waste without you guys, Thanks a ton!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1