+ Reply to Thread
Results 1 to 10 of 10

Array formula returns zero, but evaluate formula shows a value

  1. #1
    Registered User
    Join Date
    07-05-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    13

    Array formula returns zero, but evaluate formula shows a value

    Hey Excel Forum community,

    This is a bit of a strange one. I have an array formula with a lot of components to it so I won't explain all of the logic here. The puzzle is that the formula is returning zero even though stepping through the evaluate formula to the final stage shows that the answer should be around 0.34 (see screenshots attached)

    screenshot1.png

    screenshot2.png

    It is not a problem with decimal places or cell formatting as far as I can see. Searching the forum and google hasn't come up with anything. Has anyone encountered and conquered this problem before?

    Cheers,
    Griffin

  2. #2
    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
    52,933

    Re: Array formula returns zero, but evaluate formula shows a value

    Did you put those{ } in manually? Because when you edit a formula (like your pic seems to indicate, you dont see them inthe formula bar. If you entered them manually, that would probably be why you are not getting your expected answer. You need to 1st create the formula (without the curly braces {} ), then you need enter ARRAY formulas using CTRL SHT ENTER, not just enter
    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

  3. #3
    Registered User
    Join Date
    07-05-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Array formula returns zero, but evaluate formula shows a value

    Thanks for the quick reply. Yes, I hit CTRL SHT ENTER for the array formula. The formula in the picture is not being edited at the time of the screenshot.

  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
    52,933

    Re: Array formula returns zero, but evaluate formula shows a value

    OK, its kinda hard to see from a screenshot, what exactly are you trying to do?

    Have you considered other formulas for this, like sumifS() or sumproduct(), for instance?

  5. #5
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Array formula returns zero, but evaluate formula shows a value

    Quote Originally Posted by GriffinCarpenter View Post
    The puzzle is that the formula is returning zero even though stepping through the evaluate formula to the final stage shows that the answer should be around 0.34 (see screenshots attached)
    Attachment 345214
    Attachment 345215
    Whoever said "a picture is worth 1000 words" does not know how to debug Excel problems. It would be better to upload an example Excel file to a file-sharing website and post the shared/public URL in a response here.

    [ERRATA] Oh, I forgot: this forum permits you to attach files to a posting. So it would be better to attach an example Excel file.

    That said, I can duplicate what you see by the following paradigm:

    1. Set Manual calculation mode.
    2. Enter 0 into A1.
    3. Enter 0.241889783497524 into A2.
    4. Enter =A1*A2 into A3. The result is zero.
    5. Enter 1.27397651447924 into A1. Note that A3 is still zero.
    6. Use Evaluate Formula to step through the calculation of A3.

    In step #6, we see =1.27397651447924*0.241889783497524 just before the last step, but we see =0 after the last step.

    Does Manual calculation mode explain your problem?
    Last edited by joeu2004; 09-14-2014 at 02:52 AM. Reason: errata

  6. #6
    Registered User
    Join Date
    07-05-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Array formula returns zero, but evaluate formula shows a value

    Thank you FDibbins and joeu2004 for your replies. Manual calculation was not the issue although it was a good idea (file large and confidential unfortunately). In the end it looks like there was a circular reference somewhere in the formula that was causing an issue. It's interesting that this would come up in the last simple multiplication rather than where the circular reference actually occurred. Thanks again for your help.

  7. #7
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Array formula returns zero, but evaluate formula shows a value

    Quote Originally Posted by GriffinCarpenter View Post
    In the end it looks like there was a circular reference somewhere in the formula that was causing an issue. It's interesting that this would come up in the last simple multiplication rather than where the circular reference actually occurred. Thanks again for your help.
    Glad you found the root cause. There should have been an indicator of the circular reference, usually (but not always) in the lower left of the bottom status bar (not included in your screen shot), and certainly when you entered the formula.

    As for the behavior of Evaluate Formula.... My understanding is: it does not change the cell value. Think of it as stepping through the cell calculation on scratch paper. But it displays the current cell value in the last step, which we knew was zero.

  8. #8
    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
    52,933

    Re: Array formula returns zero, but evaluate formula shows a value

    Im glad you found the problem circ ref's can be tricky to resolve, they dont always appear where excel says they are.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  9. #9
    Registered User
    Join Date
    07-05-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Array formula returns zero, but evaluate formula shows a value

    Haha you're too quick! I was just taking care of both.

  10. #10
    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
    52,933

    Re: Array formula returns zero, but evaluate formula shows a value

    Well thanks for the feedback then

  11. #11
    Registered User
    Join Date
    01-27-2015
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    1

    Re: Array formula returns zero, but evaluate formula shows a value

    I've just come across this behavior too. "Evaluate formula" seems to show the steps of evaluating the first cell in an array formula regardless of which cell in the array formula you've actually selected.

+ 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. Evaluate an Array Formula
    By rodrigoxsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2014, 05:26 PM
  2. [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
  3. [SOLVED] Unable to get result Using FormulaArray or Evaluate with Array Formula in VBA
    By :) Sixthsense :) in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 05-30-2013, 11:27 PM
  4. [SOLVED] Using Evaluate With Array Formula
    By :) Sixthsense :) in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-10-2013, 06:47 AM
  5. Replies: 4
    Last Post: 08-25-2010, 02:43 PM

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