+ Reply to Thread
Results 1 to 8 of 8

Repeat Item a Number of Times based on Cell Value

  1. #1
    Registered User
    Join Date
    12-18-2008
    Location
    Bolivia
    Posts
    42

    Question Repeat Item a Number of Times based on Cell Value

    Hello all!

    I have a quick problem that hopefully someone can help me with

    Basically I have column C which has Item numbers for different products. This list, in my original workbook, is generated using dynamic arrays, so it is dynamic and automatic.

    I also have column D which has the number of times I want the item number to be repeated (this list is also generated using dynamic arrays in my original workbook).

    What I need is shown in column G.
    As you can see the items are in one column repeated the number of times that is specified in column B.

    How could I accomplish this?
    If at all possible, maybe try to make the solution use dynamic arrays so everything is automatic and dynamic?
    If not possible, any other type of formula will be well received and deeply thanked!

    I thank you in advance for the help!

    Best regards!

    segrxgW.png
    ________________________
    Orlando Nunez B., M.S.
    Project Engineer
    IASA Construction Company
    Santa Cruz - Bolivia

  2. #2
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,259

    Re: Repeat Item a Number of Times based on Cell Value

    Edit: I used Bebo021999's tip and got around the sucuri firewall to post formula properly.

    Try in G6 and copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For some reason I get a firewall warning when I type formula with that sign above.
    Please check file attached.

    Good luck!
    Last edited by Estevaoba; 10-22-2020 at 10:24 PM.

  3. #3
    Forum Contributor
    Join Date
    08-26-2016
    Location
    UK
    MS-Off Ver
    O365
    Posts
    260

    Re: Repeat Item a Number of Times based on Cell Value

    See attached.

  4. #4
    Forum Contributor
    Join Date
    08-26-2016
    Location
    UK
    MS-Off Ver
    O365
    Posts
    260

    Re: Repeat Item a Number of Times based on Cell Value

    Estevaoba, test your solution when the items in column C don't increment by 1 as you go down the list, or when they're alphanumeric.

  5. #5
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,259

    Re: Repeat Item a Number of Times based on Cell Value

    Well noted, p45cal. Thank you for that.
    I haven't seen your solution, but if your observation turns out as fact, I would make a little change to my formula in post #2.
    Replace the G5+1 argument with this:
    INDEX($C$6:$C$28,MATCH(G5,$C$6:$C$28,0)+1

    Cheers!
    Last edited by Estevaoba; 10-22-2020 at 10:25 PM.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Repeat Item a Number of Times based on Cell Value

    @Estevaoba,
    to avoid sucuri firewall, try to add space before and after the greater/smaller sign, like this: " > "

    @djhantulip,
    Try in J6=C6
    J7:
    Please Login or Register  to view this content.
    Drag down
    Quang PT

  7. #7
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,259

    Re: Repeat Item a Number of Times based on Cell Value

    Thanks for the tip, @Bebo021999. It works like a charm!

    Take care!
    Last edited by Estevaoba; 10-22-2020 at 10:56 PM.

  8. #8
    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,036

    Re: Repeat Item a Number of Times based on Cell Value

    Or:

    =IFERROR(INDEX($C$6:$C$28,MATCH(0,INDEX(--(COUNTIF($F$5:F5,$C$6:$C$28)=$D$6:$D$28),0),0)),"")

    see sheet.
    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

+ 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. Replies: 1
    Last Post: 07-17-2015, 02:56 AM
  2. Repeat cell values a certain number of times
    By strother1990 in forum Excel General
    Replies: 2
    Last Post: 09-24-2014, 12:43 PM
  3. 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
  4. [SOLVED] Repeat item 12 times for 12 months
    By BHammy in forum Excel General
    Replies: 5
    Last Post: 10-05-2012, 12:01 PM
  5. Replies: 1
    Last Post: 10-04-2012, 01:53 PM
  6. How to repeat a macro x number of times based on a value in a cell
    By gypsyhotelier in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2011, 05:11 PM
  7. Repeat a cell value in another column X number of times
    By art1234 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-31-2011, 02:36 PM

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