+ Reply to Thread
Results 1 to 5 of 5

Copy down formula - change colulm not row

Hybrid View

  1. #1
    Registered User
    Join Date
    01-14-2011
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    5

    Copy down formula - change colulm not row

    Hello there!

    I want it so that when I copy down a formula it with cell references in it, it changes the colulm not the row

    e.g.

    A4
    B4
    C4
    D4

    Rather than

    A4
    A5
    A6
    A7

    Thanks very much!!

    Alex

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: Copy down formula - change colulm not row

    =ADDRESS(4,ROW())

    If it's referencing the incorrect column, add a + or - value after the 'row()' text.
    e.g.
    =ADDRESS(4,ROW()+2)
    =ADDRESS(4,ROW()-3)

  3. #3
    Registered User
    Join Date
    01-14-2011
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Copy down formula - change colulm not row

    Thanks for that though it doesn't seem to do quite what I'm after - here is the whole formula:

    =AVERAGEIF('Company Footprint'!E5:'Company Footprint'!E245,1,Country_Risk!$E$4:$E$245)


    I want it to copy down as follows:

    =AVERAGEIF('Company Footprint'!F5:'Company Footprint'!F245,1,Country_Risk!$E$4:$E$245)

    =AVERAGEIF('Company Footprint'!G5:'Company Footprint'!G245,1,Country_Risk!$E$4:$E$245)

    =AVERAGEIF('Company Footprint'!H5:'Company Footprint'!H245,1,Country_Risk!$E$4:$E$245)

    =AVERAGEIF('Company Footprint'!I5:'Company Footprint'!I245,1,Country_Risk!$E$4:$E$245)

    THANK YOU!

    Alex

  4. #4
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: Copy down formula - change colulm not row

    In that case...

    =AVERAGEIF(INDIRECT("'Company Footprint'!"&ADDRESS(5,ROW())&":'Company Footprint'!"&ADDRESS(245,ROW())),1,Country_Risk!$E$4:$E$245)

    Again, bear in mind this formula uses the row number to get the required column, so if you put this formula in row 6 it'd be the equivalent of F5/245, row 9 would be I5/245, etc.

    If you needed row 2 to look in column F, you would need to adjust the row() references accordingly - i.e row()+4.

    Similarly, if any rows are subsequently added in above the data, you would need to adjust the row() value accordingly.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Copy down formula - change colulm not row

    you can use an index in average if
    =AVERAGEIF(INDEX('Company Footprint'!$F$4:$M$245,,ROW(A1)),1,Country_Risk!$E$4:$N$245)
    as you drag that down row(a1) will change to row(a2)
    so changing the column its looking at in the index row(a1)=1 =ist col of index ie col f
    row(a2)=2 2nd col of index ie =col g and so on this would go up to row(a7) col m in this case
    Last edited by martindwilson; 02-09-2011 at 11:42 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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