Discuss Scratch

kexy321
Scratcher
61 posts

I Built a Spreadsheet System in Scratch

Here is a link to the project in TurboWarp: https://turbowarp.org/1195572376
To the actual project: https://scratch.mit.edu/projects/1195572376



For two weeks, I was working on a very simple prototype of a spreadsheet system. I built all of the systems from the ground up, from the text engine to the formula system.

There are a few systems in my project. The one I'm primarily focusing on is the Formulas system.
For example, you can have a complicated formula in a cell such as:
=PROD(2 + 3, SUM(4, -2, 1) * 2) - -3^2
And, if my spreadsheet system calculated it correctly (which it did), then the answer should be 39.

This is what my Formulas system contains:
  • Ranges, as in A2 or B3:F8,
  • Arithmetic operators, which are: plus (+), minus (-), multiply (*), divide (/), mod (%) and exponents (^),
  • Additionally, you can write -x, +x or any combination of them, as in +++—–++-x, which still works.
  • Comparison operators, which are: equal to ('='), not equal to ('<>'), greater than ('>'), less than ('<'), greater than or equal to ('>=') and less than or equal to ('<='),
  • Operators for true and false values, which are: and (&&), or (||) and not (!). You use not as !x,
  • Brackets ('(' and ‘)’),
  • Functions with values in them, as in
    SUM(1, 2, 3, 4)
    .
  • There are only a few functions. I might add more, but the current ones are SUM (all numbers are added up), PROD (product; all numbers are multiplied), AVG (average), COUNT (count how many values there are).
  • It can detect many errors in formulas, such as values placed at incorrect locations, cyclic cells (where A1 relies on A2 and A2 relies on A1), etc.

The range system is smart and only retrieves the necessary cells that it needs depending on the function. For example, if there is a formula such as
=COUNT(A1:ZZZZ9999)
the range does not collect everything and instead tells the function that the range is covering that number of cells.

I'm releasing this project early so you can let me know your suggestions, improvements and issues that you see.

Last edited by kexy321 (Oct. 15, 2025 03:14:42)

kexy321
Scratcher
61 posts

I Built a Spreadsheet System in Scratch

I will be adding some updates every week or so, and I might include a documentation section right inside the project.
kexy321
Scratcher
61 posts

I Built a Spreadsheet System in Scratch

Version 0.2a has been released.
divisorsinvises
Scratcher
64 posts

I Built a Spreadsheet System in Scratch

wah cool
kexy321
Scratcher
61 posts

I Built a Spreadsheet System in Scratch

10 weeks of hiatus, but now I am currently upgrading the user experience and adding more formula functions. Those will be implemented in v0.13a.
kexy321
Scratcher
61 posts

I Built a Spreadsheet System in Scratch

v0.13a has been published, with a syntax highlighter! It additionally allows you to see issues in your equations before being evaluated. More issue detection cases will be implemented in future updates.
conicocos
Scratcher
24 posts

I Built a Spreadsheet System in Scratch

Is good
kexy321
Scratcher
61 posts

I Built a Spreadsheet System in Scratch

conicocos wrote:

Is good
I'm glad you like it!
kexy321
Scratcher
61 posts

I Built a Spreadsheet System in Scratch

Bump. v0.15a will be published tomorrow.
kexy321
Scratcher
61 posts

I Built a Spreadsheet System in Scratch

v0.15a has been published, fixing some bugs and adding a few more features to the spreadsheet system!

Powered by DjangoBB