+ Reply to Thread
Results 1 to 7 of 7

Copying a formula but changing a row reference.

Hybrid View

  1. #1
    Registered User
    Join Date
    07-05-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    74

    Copying a formula but changing a row reference.

    I have inherited a workbook that I am trying to create an overview sheet for.

    As you can see from the sample sheet attached, I need to pull metrics from the data sheet into the overview sheet to show a month by month breakdown. However, there are 60 rows between the metric reported for January and the same metric reported for February.

    I know I can go through the sheet manually and marry up each metric, but this will take an eage, given the size of the actualy workbook.

    So I am looking for a formula which will basically copy the metric formulas for January (row 5) but move the row references on by 60 rows. I'd then like to repeat that for March (another 60 rows on), etc, etc, etc.

    Can this be done?

    Thanks

    G
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Copying a formula but changing a row reference.

    Is the extra two lines at row 60 of sheet 2 an error? The solution is simpler if the tables on sheet 2 are a consistent difference apart.
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Copying a formula but changing a row reference.

    Is the extra row at row 60 of sheet 2 an error? The solution is simpler if the tables on sheet 2 are a consistent distance apart.

    What about the months? Are there always two tables between months?
    Last edited by Cheeky Charlie; 03-08-2013 at 09:23 AM. Reason: Also months offset

  4. #4
    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
    53,048

    Re: Copying a formula but changing a row reference.

    Hi there

    I would suggest a slight change to the tables on sheet 2. In the attached suggestion, I have (started to ) created a table that will groww sideways as the months progress. That makes it easier to use index/match to return the values you want.

    Take a look and let me know if that is something you can work with?
    Attached Files Attached Files
    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

  5. #5
    Registered User
    Join Date
    07-05-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Copying a formula but changing a row reference.

    Thanks FDibbins, but I can't make any changes to sheet 2 - life would be so much easier if I could! (there are actually several tables horizontally across the sheet)

  6. #6
    Registered User
    Join Date
    07-05-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Copying a formula but changing a row reference.

    Cheeky Charlie - I was confused as to why you were asking to begin with but then I realised that I had labeled the metrics in the two different sales the same.

    I have uploaded a better example which indicates that metric 1, for example, appears in row 3 and 63 (123 for March, 183 for April etc) so yes, there is a consistent difference between the associated metrics.

    Does that help?
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Copying a formula but changing a row reference.

    Yes. Constant difference means a simpler formula. Good news for you.
    Your example is slightly misleading in that you've labelled B:C on overview 'metric 27' but it points at metric 126 in Data.
    Rather than get hung up on it, here is a simple and adaptable formula that addresses your needs:
    =B5
    INDEX(Data!C:C,ROW(1:1)*60-2)
    Copy across one and down to the bottom.

    This works by addressing the entirety of column C and pulling the value at address (row*60)-2. This equates to 58 for row 1, and 118 for row 2. To make an equivalent you need to tinker with the offset (-2) to make it point at the relevant row.

+ 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