+ Reply to Thread
Results 1 to 11 of 11

copy ref cell to next row incremented by 3

  1. #1
    Registered User
    Join Date
    09-24-2014
    Location
    Houston
    MS-Off Ver
    7
    Posts
    24

    Question copy ref cell to next row incremented by 3

    I have multiple refence cells that I would like to copy down to next empty row by increments of 3, such as:

    Currently

    =A6 =D5 =F5 =G5 =H5 =E5


    =A9 =D8 =F8 =G8 =H8 =E8


    =A12 =D11 =F11 =G11 =H11 =E11


    =A15 =D14 =F14 =G14 =H14 =E14

    would like to be able to copy without blank rows, such as:

    =A6 =D5 =F5 =G5 =H5 =E5
    =A9 =D8 =F8 =G8 =H8 =E8
    =A12 =D11 =F11 =G11 =H11 =E11
    =A15 =D14 =F14 =G14 =H14 =E14

    Is there a formula I can use to copy a single referenced group (row) down by 3?

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: copy ref cell to next row incremented by 3

    =INDEX(A:A,3*ROW(A2))

    and copy down, change range as needed
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: copy ref cell to next row incremented by 3

    Oh hey, and an even more efficient formula:

    =INDIRECT(CHOOSE(COLUMN(A1),"A","D","F","G","H","E")&3*ROW(A2))

    No need to change ranges or references. Just copy and drag all over.

  4. #4
    Registered User
    Join Date
    09-24-2014
    Location
    Houston
    MS-Off Ver
    7
    Posts
    24

    Re: copy ref cell to next row incremented by 3

    Sorry, I think I handicapped you by not providing what I was looking at and how I am trying to finish....
    PERFORMANCE TABLE.jpg
    please see image...

  5. #5
    Registered User
    Join Date
    09-24-2014
    Location
    Houston
    MS-Off Ver
    7
    Posts
    24

    Re: copy ref cell to next row incremented by 3

    This is a copy of the results that I am trying to achieve, without going line by line
    Preffered Performance Table Results.jpg

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: copy ref cell to next row incremented by 3

    Attach a sample workbook. Many users are unable to view images attached in this forum due to firewall restrictions. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  7. #7
    Registered User
    Join Date
    09-24-2014
    Location
    Houston
    MS-Off Ver
    7
    Posts
    24

    Re: copy ref cell to next row incremented by 3

    Please see spreadsheet

    Tab 1 (Performance Table - Start) is how I was starting to copy with spaces to get data organized...but then have to copy numbers/paste valves before deleting empty rows.

    Tab 2 (Preffered Results) is how I am trying to get data organized.

    Thanks for the help
    Attached Files Attached Files

  8. #8
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: copy ref cell to next row incremented by 3

    Not much changes, just exlude the A from the assorted columns.

    The formula in post 3 applies to S5:W5, minor adjustments to L5:Q5 and works just fine.
    Attached Files Attached Files
    Last edited by daffodil11; 09-25-2014 at 11:40 AM. Reason: persecuted by the grammar police

  9. #9
    Registered User
    Join Date
    09-24-2014
    Location
    Houston
    MS-Off Ver
    7
    Posts
    24

    Re: copy ref cell to next row incremented by 3

    This works well. I appreciate your help, I am just trying to understand (in my head) how the two separate forumals work. Quick question, Why Text in fron of the Indirect function?

  10. #10
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: copy ref cell to next row incremented by 3

    Oh, I was attempting to preserve your 001 format. Text(reference,"000") changes 1, 2, 5 into 001, 002, 005 by preserving the leading zeroes.

    As for the other formula:

    =INDIRECT(CHOOSE(COLUMN(A1),"D","F","G","H","E")&3*ROW(A2)-1)


    INDIRECT works by taking a string, and evaluating it as a reference

    =A1 is a fairly obvious reference, but =A&100-1 doesn't really mean anything to Excel. Instead we use INDIRECT("A" & 100 - 99) which becomes INDIRECT(A1) and then Excel looks at string between the parentheses and evaluates whatever is there as a reference to a cell.

    The trick here is to come up with an expression that increments how you need. Your first set starts at 5 and goes by 3. I went with 3 x 2 - 1.

    CHOOSE takes the first arugment, and chooses that of the next N paramaters, such that CHOOSE(1,1,2,3) = 1, CHOOSE(2,1,2,3) = 2, CHOOSE(3,1,2,3) = 3

    COLUMN(A1) is a shortcut for writing the number 1, such that this number will increment as the formula is copied across columns. This formula in a given cell copied one cell to the right become COLUMN(B1) = 2, further right again COLUMN(C1) = 3, and so on. So instead of writing 1, 2, 3, etc formula designers will use row() and column() when copying formulas up and down and left to right.


    Let's evaluate this formula from the inside out to watch it work. We can do this by highlighting sections of it and hitting F9.

    =INDIRECT(CHOOSE(COLUMN(A1),"A","D","F","G","H","E")&3*ROW(A2))
    =INDIRECT(CHOOSE({1},"D","F","G","H","E")&3*ROW(A2)-1)
    =INDIRECT({"D"}&3*ROW(A2)-1)
    =INDIRECT({"D"}&3*{2}-1)
    =INDIRECT({"D"}&{5})
    =INDIRECT({"D5"})
    =D5


    We copy this formula down 5 rows, and over 4 columns and see its reference change:
    =INDIRECT(CHOOSE(COLUMN(E6),"D","F","G","H","E")&3*ROW(E7)-1)
    =INDIRECT(CHOOSE({5},"D","F","G","H","E")&3*ROW(E7)-1)
    =INDIRECT({"E"}&3*ROW(E7)-1)
    =INDIRECT({"E"}&3*{7}-1)
    =INDIRECT({"E"}&{20})
    =INDIRECT({"E20"})
    =E20

  11. #11
    Registered User
    Join Date
    09-24-2014
    Location
    Houston
    MS-Off Ver
    7
    Posts
    24

    Thumbs up Re: copy ref cell to next row incremented by 3

    [SOLVED] Thank you so much for explaning formulas

+ 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] Cell J6 value to be auto incremented.
    By sqlindia in forum Excel General
    Replies: 4
    Last Post: 06-13-2013, 01:00 PM
  2. Create nth copy of page 2, then reference first page with incremented row
    By leesjunkmail001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-29-2009, 02:21 AM
  3. Returning an incremented value in one column
    By terry_f in forum Excel General
    Replies: 7
    Last Post: 04-20-2007, 08:52 AM
  4. Setting up an incremented Variable name
    By David Looney in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2005, 03:05 PM
  5. How can a single cell be incremented? i.e. N=N+1
    By Remel in forum Excel General
    Replies: 1
    Last Post: 09-21-2005, 04: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