+ Reply to Thread
Results 1 to 10 of 10

Copying down Array formula gives wacky results

  1. #1
    Registered User
    Join Date
    03-15-2010
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    72

    Copying down Array formula gives wacky results

    I have the below array formula in cell AA6:

    Please Login or Register  to view this content.
    This provides the correct result, but when I copy and paste AA6 into AA7 - AA18 or grab the bottom right of AA6 and drag it to AA18, the cells below give wacky results and I can't figure out why. If I double click AA6, copy the formula, double click in AA7, paste the formula, then manually modify the needed cell references ("...- RDD'!$A6", "...- RDD'!$B6", "...- RDD'!$C6"), it works.

    Data as it should be (with the manual update to each cell):
    Please Login or Register  to view this content.
    Data after dragging & dropping or copy/paste:
    Please Login or Register  to view this content.
    not being able to copy the formula with accurate results is frustrating and there are a number of cells that need to update. I have other array formulas in my spreadsheet and they copy/paste without any issues. Any help or suggestions are appreciated.

    r/

    SUPPO
    Last edited by SUPPO_USN; 06-06-2016 at 11:01 AM.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Copying down Array formula gives wacky results

    Can you post a sample file?

    Also why bother with an array when the AVERAGEIF(s) formula exists?
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Copying down Array formula gives wacky results

    To resolve this we need to see your data, not just the formula result. Can you attach your file?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    03-15-2010
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Copying down Array formula gives wacky results

    mikeTRON,

    I was not aware of the AVERAGEIF(s) formula when tackling this problem. I managed to get a similar array formula working elsewhere in my sheet and modified it as needed in this instance.

    As for a sample file, I'll see what I can do to get something posted. I will need to desensitize it prior to posting.

    r/

    SUPPO

  5. #5
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Copying down Array formula gives wacky results


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

    Re: Copying down Array formula gives wacky results

    Quote Originally Posted by mikeTRON View Post
    Also why bother with an array when the AVERAGEIF(s) formula exists?
    AVERAGEIFS won't work in this case because there is array manipulation subtracting one range from another:

    ...IF('Data with Outliers'!$H$5:$H$1053>'Data with Outliers'!$G$5:$G$1053,'Data with Outliers'!$I$5:$I$1053-'Data with Outliers'!$H$5:$H$1053,'Data with Outliers'!$I$5:$I$1053-'Data with Outliers'!G4:G1052
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    03-15-2010
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Copying down Array formula gives wacky results

    Sorry for the late response. It took a while to get the file sanitized. As a recap, I'm having issues with Column AA of the "Hold Time Analysis - RDD" worksheet. When I drag or copy the formula in Cell AA6 down to AA18, the results are NOT Correct. I manually calculated the answers in Column AD and those are the results that should be showing after dragging or copying. as I said above, if I double click AA6, copy the formula, double click AA7, paste the formula, and manually change the references, it works.

    Any input on why this isn't working would be appreciated.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Copying down Array formula gives wacky results

    As near as I can tell, it is because the last reference in the formula ('Data with Outliers'!$I$5:$I$1053-'Data with Outliers'!G4:G1052) is a relative reference, instead of the absolute references used for all of the other references to "Data with outliers". I also note that the range in AA7 is different from AA6 (G5:G1053). It seems that it should work if you make that reference an absolute reference, and maybe check if AA6 should refer to G5:G1053 like the other cells in that column.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  9. #9
    Registered User
    Join Date
    03-15-2010
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Copying down Array formula gives wacky results

    It's always the little things that take the longest time to find. I'd looked at that code I don't know how many times and never noticed it wasn't an absolute reference like everything else and like it should have been. thanks for your extra set of eyes. 'Data with Outliers'!$I$5:$I$1053-'Data with Outliers'!$G$5:$G$1053 fixed my issue.

    r/

    SUPPO

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Copying down Array formula gives wacky results

    If it helps in the future, I found the error by:
    1) turning R1C1 notation on (temporarily). Unlike A1 notation, copied cells in R1C1 notation should have the exact same formula string (the text you see in the formula bar).
    2) Scrolled through the column, looking for any changes or differences in the formula string. The only reference that I saw changing was the last one. In R1C1 notation, it can sometimes be easier to see the changes.
    3) Then, studied the changing references to see why they are changing from copy to copy.
    4) turn A1 notation back on.

+ 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] VBA - formula results not copying to next worksheet
    By annegrey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2015, 12:05 AM
  2. Copying results of a formula across
    By brendan2711 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2015, 02:48 AM
  3. Replies: 6
    Last Post: 04-25-2014, 10:31 AM
  4. [SOLVED] Copying results from a formula
    By zachdking in forum Excel General
    Replies: 4
    Last Post: 10-16-2013, 02:18 AM
  5. Replies: 6
    Last Post: 05-26-2012, 04:56 AM
  6. unexpected results when copying a formula
    By plumcloth in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-29-2010, 12:35 PM
  7. copying formula results
    By np1966 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2009, 07:16 AM

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