+ Reply to Thread
Results 1 to 4 of 4

Repeat Rows Based on Column

  1. #1
    Registered User
    Join Date
    11-22-2016
    Location
    UK
    MS-Off Ver
    Microsoft Office 2011 (Mac)
    Posts
    6

    Repeat Rows Based on Column

    I would like to create a spreadsheet that repeats the values found in one column numerous times an extra column based on the contents of a third column.

    It is quite hard to explain so I have attached a sheet showing example input and desired output (in the second tab).

    One the input column the number of rows will vary for SKU, Special Price and Website ID.

    Thanks!
    Attached Files Attached Files

  2. #2
    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,148

    Re: Repeat Rows Based on Column

    Try

    In Output

    A2

    =IF(ROWS($1:1)<=(COUNTA(Input!$A:$A)-1)*(COUNTA(Input!$E:$E)-1),OFFSET(Input!$A$2,MOD(ROWS($A$1:$A1)-1,COUNTA(Input!$A:$A)-1),,1),"")

    B2

    =IF(ROWS($1:1)<=(COUNTA(Input!$A:$A)-1)*(COUNTA(Input!$E:$E)-1),OFFSET(Input!$A$2,MOD(ROWS($A$1:$A1)-1,COUNTA(Input!$B:$B)-1),1,1),"")

    C2

    =IF(ROWS($1:1)<=(COUNTA(Input!$A:$A)-1)*(COUNTA(Input!$E:$E)-1),OFFSET(Input!$A$2,INT((ROWS($A$1:$A1)-1)/(COUNTA(Input!$A:$A)-1)),4,1),"")
    Attached Files Attached Files

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Repeat Rows Based on Column

    Try this in Output!A2 and copy to A2:B12
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In Output!C2 and copy down the following formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    where Input!$C$1 is the number of sku items for website

    See the file
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-22-2016
    Location
    UK
    MS-Off Ver
    Microsoft Office 2011 (Mac)
    Posts
    6

    Re: Repeat Rows Based on Column

    Quote Originally Posted by JohnTopley View Post
    Try

    In Output

    A2

    =IF(ROWS($1:1)<=(COUNTA(Input!$A:$A)-1)*(COUNTA(Input!$E:$E)-1),OFFSET(Input!$A$2,MOD(ROWS($A$1:$A1)-1,COUNTA(Input!$A:$A)-1),,1),"")

    B2

    =IF(ROWS($1:1)<=(COUNTA(Input!$A:$A)-1)*(COUNTA(Input!$E:$E)-1),OFFSET(Input!$A$2,MOD(ROWS($A$1:$A1)-1,COUNTA(Input!$B:$B)-1),1,1),"")

    C2

    =IF(ROWS($1:1)<=(COUNTA(Input!$A:$A)-1)*(COUNTA(Input!$E:$E)-1),OFFSET(Input!$A$2,INT((ROWS($A$1:$A1)-1)/(COUNTA(Input!$A:$A)-1)),4,1),"")
    Thanks. Worked perfectly.

+ 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] VBA to Repeat rows from its column
    By irruzzz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2014, 02:31 AM
  2. [SOLVED] Repeat values in another column after every n rows
    By kuntalnr in forum Excel General
    Replies: 1
    Last Post: 01-30-2014, 01:37 PM
  3. Rows/Column Repeat is locked
    By amartino44 in forum Excel General
    Replies: 2
    Last Post: 04-10-2013, 07:36 PM
  4. [SOLVED] Count repeat numbers in column B based on a condition from Column Al
    By helpbitte in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2012, 10:11 AM
  5. VB to split and repeat rows based on cell values
    By rgjohnson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2010, 06:57 PM
  6. [SOLVED] repeat a formula same column same number of rows apart
    By steveo in forum Excel General
    Replies: 2
    Last Post: 07-10-2006, 03:29 AM
  7. [SOLVED] repeat a formula same column same number of rows apart
    By steveo in forum Excel General
    Replies: 1
    Last Post: 07-10-2006, 03:29 AM

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