+ Reply to Thread
Results 1 to 7 of 7

Excel 2010 Not Calculating Cells With User-defined Formula

  1. #1
    Registered User
    Join Date
    07-06-2010
    Location
    London
    MS-Off Ver
    2010
    Posts
    11

    Excel 2010 Not Calculating Cells With User-defined Formula

    I stumbled upon a simple but yet a strange problem. I have made a small working sample that reproduces the problem.

    So in the spreadsheet, I have two tables, Range1 and Range2. I also have a module with a function called
    Please Login or Register  to view this content.
    .

    Range1 contains a column named 'added quantity' in which the cells are calculated using the 'dummy' function. The 'dummy' function just looks for the 'multiplier' that corresponds to the 'multiplierID' in 'Range2', and multiplies it to the 'quantity' and returns the product.

    The problem now is this: I was expecting that if I change the value of a multiplier in Range2, the corresponding dependent cells in Range1 should change but they don't, even if I hit calculate. The cells only change if I re-commit the formula, meaning if I choose the cell and re-enter the same formula. Even worse, even if I apply the formula to all cells, the cells don't update, I either have to re-enter the formula for each individual cells or do the old-fashioned dragging.

    I have attached the workbook in this thread.

    Please note: I know that I could have written the function straight into the cells which would have made it work but here I'm just trying to represent my problem in a simple way, as in my original workbook the function contents are 'slightly' more complex.

    Many thanks for your help,
    Attached Files Attached Files
    Last edited by ld_pvl; 01-09-2011 at 02:44 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Excel 2010 Not Calculating Cells With User-defined Formula

    Hi ld_pvl and welcome to the forum.

    You need to read and understand http://www.decisionmodels.com/calcsecretsj.htm#nocalc

    Scroll down the above page and look for the Application.Volatile line. I tihnk this will help.
    Last edited by MarvinP; 01-07-2011 at 11:50 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    07-06-2010
    Location
    London
    MS-Off Ver
    2010
    Posts
    11

    Re: Excel 2010 Not Calculating Cells With User-defined Formula

    Thank you! Forgot about volatility. That solved my problem.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Excel 2010 Not Calculating Cells With User-defined Formula

    Whenever possible avoid Volatile UDFs

    In this instance you would pass variables as Ranges inclusive of 2nd Table such that all cells become "precedent" cells of the function.
    This means that when those precedent cells alter they will flag the UDF as requiring recalc. - as per a normal formula.

    Of course, in reality, there is no need for a UDF at all:

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 01-08-2011 at 06:04 AM. Reason: edited - didn't read the UDF properly!

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Excel 2010 Not Calculating Cells With User-defined Formula

    Hey DO,

    I'm having trouble finding the "@" notation explaination. I've got the Evaluate is the same as "[ ]", but where does @ come in. Can you point me to a web page that expains this?

    Also in your formula above, why doens't "=[Range1[initial quantity]]" work as well as "=[@[initial quantity]]"

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Excel 2010 Not Calculating Cells With User-defined Formula

    This is not an Evaluate method - we're using TABLE object syntax.

    Quote Originally Posted by MarvinP
    where does @ come in
    The @ refers to ThisRow of TABLE object
    (when you type a formula into a TABLE you will see the various syntax options)

    If you refer to the TABLE explicitly (assumed relative otherwise) then you would not encase the TABLE name within [ ], ie:

    Please Login or Register  to view this content.
    Though of course if you add the above within the Range1 TABLE it will dispense with the reference.

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Excel 2010 Not Calculating Cells With User-defined Formula

    Can you be more specific on this
    (when you type a formula into a TABLE you will see the various syntax options)
    I must be dense or having a bad learning day.
    Keystroke level? How do I see all those options?

    This is close but no "@" http://office.microsoft.com/en-us/ex...010155686.aspx

    I found it at http://www.jkp-ads.com/articles/Excel2007Tables.asp
    where the claim is the "@" was new to 2010 Excel.
    Search for "Excel Tables This Row"

    Time to go study some more!
    Last edited by MarvinP; 01-08-2011 at 03:40 PM. Reason: Still Learning and too quick to message

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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