+ Reply to Thread
Results 1 to 5 of 5

Excel VBA Replace Formula Array

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Excel VBA Replace Formula Array

    Hello,

    I am trying to make the cell B5 to receive an Array Formula. By Researching on Internet I could see there is a limitation of 255 characters on Array Formulas, this way, it is needed to brake down the formula in two pieces and use Replace function, but I still get the error:

    "Unable to set the FormulaArray property of the Range class"

    The original formula is: =IFERROR(AVERAGE(IF(('@Daily Data Temp'!$F2:$F3942='S1DAY P1(Ongoing)'!$F$1)*('@Daily Data Temp'!$E2:$E3942='S1DAY P1(Ongoing)'!$G$1)*('@Daily Data Temp'!$D2:$D3942='S1DAY P1(Ongoing)'!$A5)*('@Daily Data Temp'!$J2:$J3942='S1DAY P1(Ongoing)'!$H$1)*('@Daily Data Temp'!$B2:$B3942=$I$1)*('@Daily Data Temp'!$H2:$H3942=B$3),'@Daily Data Temp'!$I2:$I3942)),"N/A")


    But by using the Excel VBA it needs to translate(I used macro to record) and here is the code.
    Please Login or Register  to view this content.


    Can anyone help me please?

    Thanks!
    Last edited by trizzo; 11-10-2014 at 08:45 AM. Reason: Removed space of Last Temp row

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel VBA Replace Formula Array

    Is the formula being used on either of the @Daily Data Temp or S1DAY P1(Ongoing) sheets, or on another sheet?
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Excel VBA Replace Formula Array

    Hey romperstomper, thanks for the quick reply!

    The formula is being used on 'S1DAY P1(Ongoing)' Sheet

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel VBA Replace Formula Array

    Since you're using 2007, you can shorten that formula to:

    =IFERROR(AVERAGEIFs('@Daily Data Temp'!$I2:$I3942,'@Daily Data Temp'!$F2:$F3942,$F$1,'@Daily Data Temp'!$E2:$E3942,$G$1,'@Daily Data Temp'!$D2:$D3942,$A5,'@Daily Data Temp'!$J2:$J3942,$H$1,'@Daily Data Temp'!$B2:$B3942,$I$1,'@Daily Data Temp'!$H2:$H3942,B$3),"N/A")

    which does not need array-entry, so the length shouldn't be an issue.

  5. #5
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Excel VBA Replace Formula Array

    It worked great romperstomper, thanks a lot!

+ 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] index match array formula - replace cell references with ranges
    By nigelog in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-17-2014, 10:39 AM
  2. [SOLVED] Replace ARRAY formula with VBA code
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-02-2014, 08:29 AM
  3. Macro which replace large array formula
    By ALEZI in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2014, 02:32 PM
  4. [SOLVED] Formula to replace this array
    By cboys00 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2012, 08:47 PM
  5. Replace hard coded array in formula with link to input array
    By David Brown in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-08-2011, 07:45 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