+ Reply to Thread
Results 1 to 5 of 5

Evaluate Array Formula Issue

  1. #1
    Registered User
    Join Date
    02-10-2017
    Location
    Chester, England
    MS-Off Ver
    2010
    Posts
    13

    Evaluate Array Formula Issue

    Hi guys,

    I have a list of numbers in a column in Excel. Some, however, have been entered as text whilst others are 'true' numbers and so I use an array formula to sum the column as follows;

    ={SUM(IFERROR(VALUE(iData!A2:A50),0))}

    Note: the IFERROR is in there as there are also cells with other random text in that the VALUE function does not like so I'm ignoring those and resolving to 0).

    My query is; if I enter the following in VBA,

    Total = Evaluate("=SUM(IFERROR(VALUE(iData!A2:A50),0))") then my new variable 'Total' is only summing the numeric cells in the range A2:A50....the numbers entered as text aren't being recognised??

    My understanding was that the two methods should do the same thing, no?

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,944

    Re: Evaluate Array Formula Issue

    I get the correct number with both methods:

    Capture.JPG
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    02-10-2017
    Location
    Chester, England
    MS-Off Ver
    2010
    Posts
    13

    Re: Evaluate Array Formula Issue

    Hey Bernie

    I've had another look and it appears that the troublesome text values have a '£' prefix. So my VBA statement seems to work in summing 2,5, & '5' to equal 12 but only returns 7 when summing 2,5 & '£5'. The spreadsheet formula doesn't seem to mind the currency prefix...

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,944

    Re: Evaluate Array Formula Issue

    VBA is US-centric, so $s are ignored but not £

    Try this

    Evaluate("=SUM(IFERROR(VALUE(iData!A2:A50),IFERROR(VALUE(SUBSTITUTE(iData!A2:A50,""£"","""")),0)))")

  5. #5
    Registered User
    Join Date
    02-10-2017
    Location
    Chester, England
    MS-Off Ver
    2010
    Posts
    13

    Re: Evaluate Array Formula Issue

    Aah...that's sorted it

    Thank you!!

+ 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] EVALUATE an R1C1 formula currently stored in an array
    By JBeaucaire in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-07-2016, 11:01 PM
  2. [SOLVED] Evaluate array formula & convert it to UDF
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2015, 07:53 PM
  3. Application.Evaluate not working - Array Formula
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-28-2015, 01:12 AM
  4. Question about using Evaluate with an array of formulas not an array formula
    By Mr_Bill in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2014, 03:26 PM
  5. Evaluate an Array Formula
    By rodrigoxsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2014, 05:26 PM
  6. [SOLVED] Evaluate Named Range Array formula to VBA Array
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-07-2014, 09:06 PM
  7. [SOLVED] Using Evaluate With Array Formula
    By :) Sixthsense :) in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-10-2013, 06:47 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