+ Reply to Thread
Results 1 to 10 of 10

How to copy multiple excel rows X amount of times

  1. #1
    Registered User
    Join Date
    04-21-2017
    Location
    London
    MS-Off Ver
    7
    Posts
    7

    How to copy multiple excel rows X amount of times

    Hi all,

    I have an excel spreadsheet with around 840 rows, each row has several columns followed by a 'count' column. For example, there are 500 (count) people aged 1 (age) in the year 2000 (year) in region 7 (region).

    Is there a way to expand each row to actually represent the 'count' i.e. expand the first row to 577 times, the next to X amount of times it says count for and so on?

    I hope i've explained this in a way that makes sense!

    Kind regards

  2. #2
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: How to copy multiple excel rows X amount of times

    Yes it makes sense.but it will make easy for those who may want to help you, if you upload a workbook with sample data (Do not included 840 rows,,,maximum 20 rows would be enough for applying a solution on).Data must be desensitized in the sample WB.


    Post a WORKBOOK.
    Nobody wants to type data from a picture or paste text from your post into a spreadsheet as a prelude to helping. To attach a file, scroll down to the Manage Attachments button, browse to the required file, and then push the Upload button.
    Teach me Excel VBA

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: How to copy multiple excel rows X amount of times

    Yep. With this array formula:
    =IFERROR(INDEX(A$2:A$4,MATCH(0,--(COUNTIF(F$1:F1,A$2:A$4)=$D$2:$D$4),0)),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    04-21-2017
    Location
    London
    MS-Off Ver
    7
    Posts
    7

    Re: How to copy multiple excel rows X amount of times

    Thank you! I have attached an example file here!
    Last edited by cbroadhurst; 04-22-2017 at 08:40 AM.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: How to copy multiple excel rows X amount of times

    My effort will accommodate that OK. It might be a tad slow to run, but it'll get there...

  6. #6
    Registered User
    Join Date
    04-21-2017
    Location
    London
    MS-Off Ver
    7
    Posts
    7

    Re: How to copy multiple excel rows X amount of times

    Thanks Glenn, I'm very new to this. How do I add an additional column before the count column? In addition, how do i expand the yellow box to accommodate my many individuals!

    Thank you for your help

  7. #7
    Registered User
    Join Date
    04-21-2017
    Location
    London
    MS-Off Ver
    7
    Posts
    7

    Re: How to copy multiple excel rows X amount of times

    How also do i align the columns in the yellow box?

  8. #8
    Registered User
    Join Date
    04-21-2017
    Location
    London
    MS-Off Ver
    7
    Posts
    7

    Re: How to copy multiple excel rows X amount of times

    Desperate for help

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: How to copy multiple excel rows X amount of times

    Be patient. You are not paying us for a service. We do this for fun and I have a life, too.

    it took about 40 seconds for Excel to calculate 7000 rows, using the formula in the attached sheet.
    Attached Files Attached Files
    Last edited by AliGW; 03-27-2018 at 12:48 AM. Reason: Attachment replaced with desensitised version.

  10. #10
    Registered User
    Join Date
    04-21-2017
    Location
    London
    MS-Off Ver
    7
    Posts
    7

    Re: How to copy multiple excel rows X amount of times

    I know sorry if i appeared rude! Thank you again you have been such a great help Have a great weekend!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Code to gather data from multiple rows in one row and copy it a number of times
    By terryhenderson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2017, 04:14 PM
  2. VBA Code Help PLS: Find Last Record on Sheet and Copy it Multiple TImes to Rows in Another
    By fadilrexhepi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2015, 08:33 AM
  3. Making Multiple Tables Have The Same Amount of Rows Using Excel VBA
    By Stryker152 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2015, 07:12 PM
  4. Macro to repeat rows a certain amount of times (loop)
    By jadore in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2014, 10:46 PM
  5. [SOLVED] Formula to copy rows of data from one page to another multiple times
    By iamcalledjosh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2013, 05:31 PM
  6. Excel 2007 : A way to copy a cell X amount of times
    By duffy1807 in forum Excel General
    Replies: 2
    Last Post: 10-02-2011, 06:29 PM
  7. Copy and paste rows multiple times
    By Novis in forum Excel General
    Replies: 5
    Last Post: 03-21-2009, 11:43 AM

Tags for this Thread

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