Practice Spreadsheet

Instructions:

  1. Enter numbers in some of the cells.
  2. Enter a formula (begin with =) in a cell (like =A1+A2)..
  3. Click the Show Formula and Show Values buttons to see the results or Clear Cells to erase everything.

A B C D E
 1 
 2 
 3 
 4 
 5 

Note: JavaScript is used to simulate the actions of simple formulas in a spreadsheet. A table with "text" forms in each cell represents a simple spreadsheet. For ease of reference, the form elements are named the same way they would be in Excel - e.g., the first text box (upper left) is named "A1". Two arrays (cells and vcells) are used to keep track of the formulas and values. A built-in function called toUpperCase is used to make sure the formula entries match the text box names (e.g., a1 becomes A1). Another built-in function called charAt finds a particular character within a string of characters (like the formulas). Within the <TD> tags you will see onChange, with the contents (value) and the name of the "cell" sent to a function called proc when the contents of the text box changes. When you see "this.value" and "this.name", it refers to the contents and name of the current form element (text box).