Consulting

Results 1 to 2 of 2

Thread: Anomaly With Formula

  1. #1
    VBAX Expert
    Joined
    Feb 2010
    Posts
    696
    Location

    Anomaly With Formula

    I have a simple formula that has worked correctly since I created it several months back. However, over the past couple of days it has been acting strangely. It is a simple formula which creates a running balance at the end of each row in a worksheet, basically just taking the prior balance and adding any current credit and substracting any current debit, as follows:

    =IF(OR(F23<>"",G23<>""),IF(ISTEXT(OFFSET(I23,-1,0)),G23-F23,OFFSET(I23,-1,0)-F23+G23),"")
    Not sure it matters, but the offset is configured to start from the cell which contains the result of the formula.

    The data and the formula are set up in a table named the same name as the worksheet.

    Now, what started happening a day or two back is that in the process of copying some data to and from the table to/from other worksheets, the formulas started returning the value from the previous row (not updating with the new balance). Then when I tried to grab a formula from a prior row and drag it down to the newly entered row, all of the formulas in those rows returned the same value.

    I've made sure that AutoCalculate is on, verified that the dollar values entered (and the formula cells) are all formatted to Currency and verified that there are no text values that have been inadvertently added to any of the cells. I've been suspicious a time or two about why the table unexpectedly inserted a Totals row. Seems like my problem started when that happened, as I received an alert that I was about to overwrite a default formula. Anyway, if anyone has any ideas about how I can further troubleshoot I'd appreciate it. I wonder if my workbook might have become corrupted. Very strange.

  2. #2
    VBAX Expert
    Joined
    Feb 2010
    Posts
    696
    Location
    Disregard. After two days I finally figured out the problem. Several days ago I entered a line of vba code which disabled calculation for that particular worksheet. Forgot about it. I just started going back through my code one line at a time and happened across this test entry. (I had begun testing whether disabling calculation for an individual worksheet was effected when global calculations were turned on, then got side-tracked.) Apparently, I now know the answer to that question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •