Abacus Recalculation

Anything QL Software or Programming Related.
Post Reply
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Abacus Recalculation

Post by swensont »

I recently got a hold of the book "Practical Astronomy with your Calculator or Spreadsheet", which had a number of spreadsheets for calculating things like Julian days and Easter Sunday. I entered the spreadsheets as listed in the book (with some minor changes) into Abacus and they worked. The Easter spreadsheet had the year entered at the top and the calculations went down the spreadsheet. The final answer was then brought back up to the top of the spreadsheet where it could easily been seen.

As I entered the formula's, it all worked well. When I went in later, changed the year, and noticed that the answer on the spreadsheet did not change. I used the command F3 - Xecute to get the spreadsheet to recalculate and eventually the right answer showed up.

After some thinking and tinkering, the issue turned out to be the way that Abacus does its recalculations. It works from the top down. So when it evaluates cell B:4, which references cell F:2, it will show the right number, but if F:2 later changes in the recalculation, B:4 is not updated.

I did some testing to see of the recalculation was from top to bottom and from left to right. I found that it was top to bottom, meaning that a top cell was recalculated first. I found that there was no issue addressing from right to left, meaning that cell B:1 would change if cell B:2 was changed.

To get my Easter spreadsheet working I had to do was to make sure that there was no cells higher in the spreadsheet, "back" addressing cells lower in the spreadsheet. It made for a less attractive speadsheet, but it made for an accurate one.

The reason it worked the first time was that I was entering each formula, one at a time, and it was recalculating as I was entering. The only cell changing was the one that I was entering.

I really am not a big user of Abacus, so I had not noticed this before. I checked the Abacus documentation and I could not find anything on the order of recalculation.


User avatar
Sparrowhawk
Super Gold Card
Posts: 643
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: Abacus Recalculation

Post by Sparrowhawk »

Good bit of detective work there! :)

I have to admit that I rarely used Abacus - I think I did one bit of (simple) economics modelling work on it at university but nothing beyond that.


a.k.a. Jean-Yves
User avatar
pjw
QL Wafer Drive
Posts: 1299
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Abacus Recalculation

Post by pjw »

Tim,

The default order of calculation is by column, but you can change that to row in the Defaults menu. See the QL Manual, which gives a comprehensive introduction to Abacus' workings.

Per


Per
dont be happy. worry
- ?
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Abacus Recalculation

Post by swensont »

Per,

You are right. Changing to Column instead of Row, allows for a back referenced formula to work. Even if the back reference is in the same column.

Tim


Post Reply