+ Reply to Thread
Results 1 to 10 of 10

Adding X No. of Rows to Cell References

  1. #1
    Registered User
    Join Date
    03-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Adding X No. of Rows to Cell References

    Hi,

    I am trying to pull values from one worksheet to another in the same workbook. The values required on Sheet1 are 30 rows apart. Is there a way of automatically adding 30 rows to the cell references on Sheet2?

    Sheet1 values are in cells A30, A60, A90, A120, A150, A180, A210 etc.

    The values from these are required in Sheet2 as follows:
    Sheet1 A30 - Sheet2 A1
    Sheet1 A60 - Sheet2 A2
    Sheet1 A90 - Sheet2 A3
    Sheet1 A120 - Sheet2 A4
    Sheet1 A150 - Sheet2 A5 etc.

    Simply dragging down the formula after adding several entries unfortunately doesn't work.

    Any ideas?

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Adding X No. of Rows to Cell References

    In Sheet 2 A1 put this:

    =INDEX(Sheet1!A:A,ROW()*30) and drag down

  3. #3
    Registered User
    Join Date
    03-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Adding X No. of Rows to Cell References

    Thanks Cutter, I have applied this and I can see it will work well.

    I should have provided the exact cells references rather than general ones as this changes things slightly. I was actually hoping to pull the values as follows:
    Sheet1 A33 - Sheet2 B2
    Sheet1 A63 - Sheet2 B3
    Sheet1 A93 - Sheet2 B4
    Sheet1 A123 - Sheet2 B5
    Sheet1 A153 - Sheet2 B6 etc.

    Would this be a straightforward amendment?

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Adding X No. of Rows to Cell References

    Yes, just adjust it.

    In B2 you put: =INDEX(Sheet1!A:A,ROW(A1)*30+3) and drag down

  5. #5
    Registered User
    Join Date
    04-26-2012
    Location
    Norwalk, CT
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Adding X No. of Rows to Cell References

    Have you used the indirect formula? It lets you create a formula based on cells/text inputs

    For example:

    If you're in sheet3, and go into a cell and click on cell A33 on Sheet1, you will see the formula "=Sheet1!A33". Pick any two cells on sheet3 (lets say B2 and C2 for this example). Type Sheet1! in B2, and A33 in C2

    in B3, type =indirect(B2&C2). This formula is now saying =indirect(Sheet1!A33), which is the same as your first formula. You can then add another 2 cells for inputs for the second cell, and just subtract. here's an example:
    Attached Files Attached Files

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Adding X No. of Rows to Cell References

    The INDIRECT() function is volatile and should not be used if it isn't necessary.

    Read more here: http://www.decisionmodels.com/calcsecretsi.htm

  7. #7
    Registered User
    Join Date
    04-26-2012
    Location
    Norwalk, CT
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Adding X No. of Rows to Cell References

    Thank you for that response, you offered absolutely nothing to helping him solve his issue. Indirect is the ideal formula for his situation.

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Adding X No. of Rows to Cell References

    What's your problem???
    INDIRECT() is not ideal - because it is volatile. Take the time to read the link I provided - especially the line: "Avoid volatile functions wherever possible."

    And I think I DID offer SOMETHING to help him solve his issue - See Post #2 and Post #4.

  9. #9
    Registered User
    Join Date
    03-26-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Adding X No. of Rows to Cell References

    Great thanks for the new formula Cutter. Thanks for your posts & attachment scottyboy I haven't come across the indirect function before so I will have a play around with that as well.

  10. #10
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Adding X No. of Rows to Cell References

    Scottyboy,

    In the future please be respectful of others' solutions - especially someone who has nearly 600x as many posts as yourself. Cutter's post regarding use of the INDIRECT function was not a personal attack against you or your opinions on the subject matter. It is a fact, and one that is agreed upon by minds far greater than my own in the Excel world. By adding it to the thread, he was simply making the original poster aware. It is up to the OP whether or not to heed that advice.

    INDIRECT certainly has its place, and can be very useful, however in this case it is probably not the best option.

    Another option, without using formulas could even be:

    In Sheet2!B2 type:

    .Sheet1!A33

    In Sheet2!B3 type:

    .Sheet1!A63

    Select both cells and use the fill handle to fill down. The next cell will change to 93, then 123, then 153, etc. Finally, select your range of cells and use the Replace dialog to replace the period with an equal sign.

    This can be done in a matter of seconds without having to ever know about INDEX or INDIRECT, but it's still up to the owner of the spreadsheet to decide which route to choose.

    Have a great day everyone.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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