+ Reply to Thread
Results 1 to 11 of 11

Repeat a formula 5 times before changing cell reference

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Repeat a formula 5 times before changing cell reference

    Hello,

    Does anyone know how I can have a formula repeat down a column five times before it changes to another formula? For example. Say on tab 1 I have a list of products. On tab two I have five codes that repeat down the page over and over again. On tab two next to the repeating codes I need to repeat product one 5 times and then skip to product 2 on the 6th row and repeat five times and then skip to product 3 on the 11th row and repeat 5 times and so on?

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Repeat a formula 5 times before changing cell reference

    Hi,

    Could you please upload your workbook? I could suggest a formula that would do the trick without it, but it's much easier to provide you with a solution that you don't have to then fit into your already existing workbook.

    Thanks

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Repeat a formula 5 times before changing cell reference

    maybe try playing around with building =MOD(ROW(),5) into your formula?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Repeat a formula 5 times before changing cell reference

    Attached is the file. On the TE Details Tab starting in A4 is where I need it to repeat 5 rows. ANO through XCL in column B. Then you will see ANO through XCL repeat over and over down column B. The codes I need populated in column A are from the running list tab column W but I want the formula to skip any value in column W on the running list tab that is labeled Duplicate or Added so that I just get the rates that I need loaded into our software.
    Attached Files Attached Files

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Repeat a formula 5 times before changing cell reference

    Maybe something like this...

    Data Range
    A
    B
    C
    1
    -----
    -----
    -----
    2
    Product1
    Product1
    3
    Product2
    Product1
    4
    Product3
    Product1
    5
    Product1
    6
    Product1
    7
    Product2
    8
    Product2
    9
    Product2
    10
    Product2
    11
    Product2
    12
    Product3
    13
    Product3
    14
    Product3
    15
    Product3
    16
    Product3
    17


    This formula entered in C2:

    =IFERROR(INDEX(A$2:A$4,CEILING(ROWS(C$2:C2)/5,1)),"")

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Repeat a formula 5 times before changing cell reference

    The products are listed on another tab though and in the list of products there are duplicates and added listed in the same list. I need to exclude those. What this is doing is getting excel data into a loadable SQL format so that they can load info into software converting excel calculations into system calculations.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Repeat a formula 5 times before changing cell reference

    If you're using Excel 2007 or later you can use the Remove Duplicates command on the Data tab then refer to the de-duped data range in the formula.

    Or, you can use advanced filter to extract the unique records to another range and then refer to this new range in the formula.

    http://contextures.com/xladvfilter01.html#FilterUR

  8. #8
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Repeat a formula 5 times before changing cell reference

    I can't remove duplicates on the first tab. 100% of the data needs to remain on that tab.

  9. #9
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Repeat a formula 5 times before changing cell reference

    Here is the file again where I added a formula on Sheet1 that removes duplicates using a formula. This is the list I would need to populate in the request above.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Repeat a formula 5 times before changing cell reference

    modifying the formula above to look at sheet one for the list without duplicates worked. Thanks so much for your help. Awesome.

    =IFERROR(INDEX(Sheet1!$O$4:$O$80,CEILING(ROWS(C$2:C2)/5,1)),"")

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Repeat a formula 5 times before changing cell reference

    You're welcome. Thanks for the feedback!

+ 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. Automatically repeat four times with a formula vertically
    By Enda80 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-05-2014, 11:47 AM
  2. 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
  3. Replies: 1
    Last Post: 04-04-2013, 05:29 PM
  4. [SOLVED] VBA: repeat a formula a number of times
    By dinahajjar in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-24-2013, 11:03 AM
  5. repeat something n times formula
    By cro4you.org in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2008, 11:14 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