What's the best way to do spreadsheet-like calculations in a programming language? Example: A multi-user application needs to be available over the web that crunches columns and cells of numbers like a spread-sheet based on user submission. What are the best data structures/ database models/patterns to handle this type of work so that handling the different columns are done efficiently and easily in php, java, or even .Net. Is it better to use data structures within the language, or is it better to use a database? If using a database is the way, how does one go about doing this?
The language employed by Excel and Google Sheets is “the world's most widely used programming language. Excel formulas are written by an order of magnitude more users than all the C, C++, C#, Java, and Python programmers in the world combined.”
Examples of spreadsheet programs are Google sheet (web-based spreadsheet program founded by Google), MS-Excel (works offline), LibreOffice, Lotus spreadsheet, etc.
VBA stands for Visual Basic for Applications. Excel VBA is Microsoft's programming language for Excel and all the other Microsoft Office programs, like Word and PowerPoint. The Office suite programs all share a common programming language.
To do the actual calculation, look at graph theory. Basically you want to represent each cell as a node in a graph and each dependency as a directed edge. Next, do a topological sort to calculate the value of each cell in the right order.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With