+ Reply to Thread
Results 1 to 5 of 5

Repeat Rows "n" amount of Times

  1. #1
    Registered User
    Join Date
    08-08-2017
    Location
    Mass
    MS-Off Ver
    2013
    Posts
    3

    Repeat Rows "n" amount of Times

    I need text and description repeated x amount of times based on on hand values. For example:

    Part number = 44-05 Description: Gloves Small Inventory: 4


    Part number = 44-06 Description: Gloves Large Inventory: 7


    So I would need Part Number and Description for the first item repeated 4 times and for the second item repeated 7 times. It's been driving me crazy that I can't work out my own formula.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Repeat Rows "n" amount of Times

    It would help if you attached a sample Excel workbook, so we can see how your data is laid out.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Please note that the Paperclip icon (Attachments button) does not work on this forum.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-08-2017
    Location
    Mass
    MS-Off Ver
    2013
    Posts
    3

    Re: Repeat Rows "n" amount of Times

    Hello,

    Click Barcodes sheet. I am trying to get Part Number, Barcode, and Description to repeat the amount of times that it shows up on as on hand value for that part number from INV Parts Sheet.

    For example,

    A2 value from Barcodes, I want the part number, barcode, and description repeated 19 times as it says in w2 from INV Parts list.


    Thank you in advance for your help.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,479

    Re: Repeat Rows "n" amount of Times

    in A2 (formula found via Google Search!)

    =IF(SUM('INV PARTS'!$W$1:$W$200)>=ROWS(A$2:A2),INDEX('INV PARTS'!$A$2:$A$200,MATCH(ROWS(A$2:A2)-1,SUBTOTAL(9,OFFSET('INV PARTS'!$W$1:$W$200,,,ROW($W$1:$W$200))))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Copy down

    in B2

    =IF(A2="","","*"&A2&"*")

    in C2 Description

    =IF(SUM('INV PARTS'!$W$1:$W$200)>=ROWS(C$2:C2),INDEX('INV PARTS'!$D$2:$D$200,MATCH(ROWS(C$2:C2)-1,SUBTOTAL(9,OFFSET('INV PARTS'!$W$1:$W$200,,,ROW($W$1:$W$200))))),"")

    ..confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.


    See "Sheet1"
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-08-2017
    Location
    Mass
    MS-Off Ver
    2013
    Posts
    3

    Re: Repeat Rows "n" amount of Times

    Thank you so much!

    Do you know any places where I can learn more about the methods behind it?
    Last edited by testtesttefsadf1; 08-09-2017 at 09:24 AM.

+ 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] Counting the amount of times "available" is stated within specicifc cells on sheets
    By ahalliwell in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 06-05-2017, 11:52 AM
  2. Macro to repeat the "If" function many times within one cell
    By ccop in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-16-2015, 07:14 PM
  3. 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
  4. [SOLVED] Macro loop to copy cells "x" amount of times in two additiional columns
    By DevfromCorrie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2014, 07:12 AM
  5. Macro or Eqn to Repeat Formula "X" times based on Number in Cell
    By waltheaj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2013, 12:24 PM
  6. Replies: 2
    Last Post: 03-02-2013, 01:34 AM
  7. [SOLVED] Repeat statements "x" number of times...
    By Frantic Excel-er in forum Excel General
    Replies: 13
    Last Post: 07-01-2005, 12:05 PM

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