Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Spreadsheet
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Concepts == The main concepts are those of a grid of [[table cell|cells]], called a sheet, with either raw data, called values, or formulas in the cells. Formulas say how to mechanically compute new values from existing values. Values are general numbers, but can also be pure text, dates, months, etc. Extensions of these concepts include logical spreadsheets. Various tools for programming sheets, visualizing data, remotely connecting sheets, displaying cells' dependencies, etc. are commonly provided. === Cells === A '''"cell"''' can be thought of as a box for holding [[data]]. A single cell is usually referenced by its column and row (C2 would represent the cell containing the value 30 in the example table below). Usually rows, representing the [[dependent and independent variables|dependent variables]], are referenced in [[decimal notation]] starting from 1, while columns representing the [[dependent and independent variables|independent variables]] use 26-adic [[bijective numeration]] using the letters A-Z as numerals. Its physical size can usually be tailored to its content by dragging its height or width at box intersections (or for entire columns or rows by dragging the column- or row-headers). {| border="1" class="wikitable" |+ My Spreadsheet ! !! A !! B !! C !! D |- !01 | Sales || 100000 || 30000 || 70000 |- !02 | Purchases || 25490 || 30 || 200 |} An array of cells is called a ''sheet'' or ''worksheet''. It is analogous to an array of [[Variable (programming)|variables]] in a conventional [[computer program]] (although certain unchanging values, once entered, could be considered, by the same analogy, [[constant (computer science)|constants]]). In most implementations, many worksheets may be located within a single spreadsheet. A worksheet is simply a subset of the spreadsheet divided for the sake of clarity. Functionally, the spreadsheet operates as a whole and all cells operate as [[global variable]]s within the spreadsheet (each variable having 'read' access only except its containing cell). A cell may contain a [[Value (computer science)|value]] or a [[formula]], or it may simply be left empty. By convention, formulas usually begin with '''=''' sign. ==== Values ==== A value can be entered from the computer keyboard by directly typing into the cell itself. Alternatively, a value can be based on a formula (see below), which might perform a calculation, display the current date or time, or retrieve external data such as a stock quote or a database value. <blockquote>'''The Spreadsheet ''Value Rule''''' Computer scientist [[Alan Kay]] used the term ''value rule'' to summarize a spreadsheet's operation: a cell's value relies solely on the formula the user has typed into the cell.<ref>{{cite journal | last1=Kay | first1=Alan | author-link=Alan Kay | title=Computer Software | journal =Scientific American | volume =251 | issue =3 | pages =52–59 |date=September 1984 | doi=10.1038/scientificamerican0984-52 | pmid=6390676 | last2=Goldstein | first2=JL| bibcode=1984SciAm.251c..52K }} – Value Rule</ref> The formula may rely on the value of other cells, but those cells are likewise restricted to user-entered data or formulas. There are no 'side effects' to calculating a formula: the only output is to display the calculated result inside its occupying cell. There is no natural mechanism for permanently modifying the contents of a cell unless the user manually modifies the cell's contents. In the context of programming languages, this yields a limited form of first-order [[functional programming]].<ref>{{cite journal|last1=Burnett |first1=Margaret|author1-link=Margaret Burnett |last2=Atwood |first2=J. |last3=Walpole Djang |first3=R. |last4=Reichwein |first4=J. |last5=Gottfried |first5=H. |last6=Yang |first6=S. |title=Forms/3: A first-order visual language to explore the boundaries of the spreadsheet paradigm |journal=Journal of Functional Programming |volume=11 |issue=2 |pages=155–206 |date=March 2001 |doi=10.1017/S0956796800003828|s2cid=18730312}}</ref> </blockquote> ==== Automatic recalculation ==== A standard of spreadsheets since the 1980s, this optional feature eliminates the need to manually request the spreadsheet program to recalculate values (nowadays typically the default option unless specifically 'switched off' for large spreadsheets, usually to improve performance). Some earlier spreadsheets required a manual request to recalculate since the recalculation of large or complex spreadsheets often reduced data entry speed. Many modern spreadsheets still retain this option. Recalculation generally requires that there are no [[circular dependency|circular dependencies]] in a spreadsheet. A [[dependency graph]] is a graph that has a vertex for each object to be updated, and an edge connecting two objects whenever one of them needs to be updated earlier than the other. Dependency graphs without circular dependencies form [[directed acyclic graph]]s, representations of partial orderings (in this case, across a spreadsheet) that can be relied upon to give a definite result.<ref>{{citation |mode=cs1 | last1=Al-Mutawa | first1=H. A. | last2=Dietrich | first2=J. | last3=Marsland | first3=S. | last4=McCartin | first4=C. | contribution=On the shape of circular dependencies in Java programs | doi=10.1109/ASWEC.2014.15 | pages=48–57 | publisher=IEEE | title=23rd Australian Software Engineering Conference | year=2014| isbn=978-1-4799-3149-1 | s2cid=17570052 }}</ref> ==== Real-time update ==== This feature refers to updating a cell's contents periodically with a value from an external source—such as a cell in a "remote" spreadsheet. For shared, Web-based spreadsheets, it applies to "immediately" updating cells another user has updated. All dependent cells must be updated also. ==== Locked cell ==== Once entered, selected cells (or the entire spreadsheet) can optionally be "locked" to prevent accidental overwriting. Typically this would apply to cells containing formulas but might apply to cells containing "constants" such as a kilogram/pounds conversion factor (2.20462262 to eight decimal places). Even though individual cells are marked as locked, the spreadsheet data are not protected until the feature is activated in the file preferences. ==== Data format ==== A cell or range can optionally be defined to specify how the value is displayed. The default display format is usually set by its initial content if not specifically previously set, so that for example "31/12/2007" or "31 Dec 2007" would default to the cell format of ''date''. Similarly adding a % sign after a numeric value would tag the cell as a [[percentage]] cell format. The cell contents are not changed by this format, only the displayed value. Some cell formats such as "numeric" or "currency" can also specify the number of [[decimal place]]s. This can allow invalid operations (such as doing multiplication on a cell containing a date), resulting in illogical results without an appropriate warning. ==== Cell formatting ==== Depending on the capability of the spreadsheet application, each cell (like its counterpart the "style" in a [[word processor]]) can be separately formatted using the [[Attribute (computing)|attributes]] of either the content (point size, color, bold or italic) or the cell (border thickness, background shading, color). To aid the readability of a spreadsheet, cell formatting may be conditionally applied to data; for example, a negative number may be displayed in red. A cell's formatting does not typically affect its content and depending on how cells are referenced or copied to other worksheets or applications, the formatting may not be carried with the content. ==== Named cells ==== [[File:Named Variables in Excel.PNG|thumb|400px|Use of named column variables ''x'' & ''y'' in [[Microsoft Excel]]. Formula for y=x<sup>2</sup> resembles [[Fortran]], and ''Name Manager'' shows the definitions of ''x'' & ''y''.]] In most implementations, a cell, or group of cells in a column or row, can be "named" enabling the user to refer to those cells by a name rather than by a grid reference. Names must be unique within the spreadsheet, but when using multiple sheets in a spreadsheet file, an identically named cell range on each sheet can be used if it is distinguished by adding the sheet name. One reason for this usage is for creating or running macros that repeat a command across many sheets. Another reason is that formulas with named variables are readily checked against the algebra they are intended to implement (they resemble Fortran expressions). The use of named variables and named functions also makes the spreadsheet structure more transparent. ===== Cell reference ===== In place of a named cell, an alternative approach is to use a cell (or grid) reference. Most cell references indicate another cell in the same spreadsheet, but a cell reference can also refer to a cell in a different sheet within the same spreadsheet, or (depending on the implementation) to a cell in another spreadsheet entirely, or a value from a remote application. A typical '''cell reference''' in "A1" style consists of one or two case-insensitive letters to identify the column (if there are up to 256 columns: A–Z and AA–IV) followed by a row number (e.g., in the range 1–65536). Either part can be relative (it changes when the formula it is in is moved or copied), or absolute (indicated with $ in front of the part concerned of the cell reference). The alternative "R1C1" reference style consists of the letter R, the row number, the letter C, and the column number; relative row or column numbers are indicated by enclosing the number in square brackets. Most current spreadsheets use the A1 style, some providing the R1C1 style as a compatibility option. When the computer calculates a formula in one cell to update the displayed value of that cell, cell reference(s) in that cell, naming some other cell(s), causes the computer to fetch the value of the named cell(s). A cell on the same "sheet" is usually addressed as: <code> =A1 </code> A cell on a different sheet of the same spreadsheet is usually addressed as: =SHEET2!A1 (that is; the first cell in sheet 2 of the same spreadsheet). Some spreadsheet implementations in Excel allow cell references to another spreadsheet (not the currently open and active file) on the same computer or a local network. It may also refer to a cell in another open and active spreadsheet on the same computer or network that is defined as shareable. These references contain the complete filename, such as: ='C:\Documents and Settings\Username\My spreadsheets\[main sheet]Sheet1!A1 In a spreadsheet, references to cells automatically update when new rows or columns are inserted or deleted. Care must be taken, however, when adding a row immediately before a set of column totals to ensure that the totals reflect the values of the additional rows—which they often do not. A [[circular reference]] occurs when the formula in one cell refers—directly, or indirectly through a chain of cell references—to another cell that refers back to the first cell. Many common errors cause circular references. However, some valid techniques use circular references. These techniques, after many spreadsheet recalculations, (usually) converge on the correct values for those cells. ===== Cell ranges ===== Likewise, instead of using a named range of cells, a range reference can be used. Reference to a range of cells is typical of the form (A1:A6), which specifies all the cells in the range A1 through to A6. A formula such as "=SUM(A1:A6)" would add all the cells specified and put the result in the cell containing the formula itself. === Sheets === In the earliest spreadsheets, cells were a simple two-dimensional grid. Over time, the model has expanded to include a third dimension, and in some cases a series of named grids, called sheets. The most advanced examples allow inversion and rotation operations which can slice and project the data set in various ways. === Formulas === [[File:Spreadsheet animation.gif|thumb|right|279px|Animation of a simple spreadsheet that multiplies values in the left column by 2, then sums the calculated values from the right column to the bottom-most cell. In this example, only the values in the <code>A</code> column are entered (10, 20, 30), and the remainder of cells are formulas. Formulas in the <code>B</code> column multiply values from the A column using relative references, and the formula in <code>B4</code> uses the <code>SUM()</code> function to find the [[Summation|sum]] of values in the <code>B1:B3</code> range.]] A formula identifies the [[calculation]] needed to place the result in the cell it is contained within. A cell containing a formula, therefore, has two display components; the formula itself and the resulting value. The formula is normally only shown when the cell is selected by "clicking" the mouse over a particular cell; otherwise, it contains the result of the calculation. A formula assigns values to a cell or range of cells, and typically has the format: {|class="wikitable" |- |<code>=''expression''</code> |} where the [[Expression (programming)|expression]] consists of: *[[Value (computer science)|values]], such as <code>2</code>, <code>9.14</code> or <code>6.67E-11</code>; *[[Reference (computer science)|references]] to other cells, such as, e.g., <code>A1</code> for a single cell or <code>B1:B3</code> for a range; *[[Operator (programming)|arithmetic operators]], such as <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, and others; *[[relational operator]]s, such as <code>>=</code>, <code><</code>, and others; and, *[[Function (programming)|functions]], such as <code>SUM()</code>, <code>TAN()</code>, and many others. When a cell contains a formula, it often contains references to other cells. Such a cell reference is a type of variable. Its value is the value of the referenced cell or some derivation of it. If that cell in turn references other cells, the value depends on the values of those. References can be relative (e.g., <code>A1</code>, or <code>B1:B3</code>), absolute (e.g., <code>$A$1</code>, or <code>$B$1:$B$3</code>) or mixed row– or column-wise absolute/relative (e.g., <code>$A1</code> is column-wise absolute and <code>A$1</code> is row-wise absolute). The available options for valid formulas depend on the particular spreadsheet implementation but, in general, most arithmetic operations and quite complex nested conditional operations can be performed by most of today's commercial spreadsheets. Modern implementations also offer functions to access custom-build functions, remote data, and applications. A formula may contain a condition (or nested conditions)—with or without an actual calculation—and is sometimes used purely to identify and '''highlight errors'''. In the example below, it is assumed the sum of a column of percentages (A1 through A6) is tested for validity and an explicit message put into the adjacent right-hand cell. :=IF(SUM(A1:A6) > 100, "More than 100%", SUM(A1:A6)) Further examples: :=IF(AND(A1<>"",B1<>""),A1/B1,"") means that if both cells A1 and B1 are not <> empty "", then divide A1 by B1 and display, other do not display anything. :=IF(AND(A1<>"",B1<>""),IF(B1<>0,A1/B1,"Division by zero"),"") means that if cells A1 and B1 are not empty, and B1 is not zero, then divide A1 by B1, if B1 is zero, then display "Division by zero", and do not display anything if either A1 and B1 are empty. :=IF(OR(A1<>"",B1<>""),"Either A1 or B1 show text","") means to display the text if either cells A1 or B1 are not empty. The best way to build up conditional statements is step by step composing followed by trial and error testing and refining code. A spreadsheet does not have to contain any formulas at all, in which case it could be considered merely a collection of data arranged in rows and columns (a [[database]]) like a calendar, timetable, or simple list. Because of its ease of use, formatting, and [[hyperlinking]] capabilities, many spreadsheets are used solely for this purpose. === Functions === [[File:Functions in Excel.PNG|thumb|400px|Use of user-defined function ''sq(x)'' in [[Microsoft Excel]] ]] Spreadsheets usually contain several supplied [[Function (mathematics)|functions]], such as arithmetic operations (for example, summations, averages, and so forth), trigonometric functions, statistical functions, and so forth. In addition there is often a provision for ''user-defined functions''. In Microsoft Excel, these functions are defined using [[Visual Basic for Applications]] in the supplied Visual Basic editor, and such functions are automatically accessible on the worksheet. Also, programs can be written that pull information from the worksheet, perform some calculations, and report the results back to the worksheet. In the figure, the name ''sq'' is user-assigned, and the function ''sq'' is introduced using the [[Visual Basic for Applications|''Visual Basic'']] editor supplied with Excel. ''Name Manager'' displays the spreadsheet definitions of named variables ''x'' & ''y''. === Subroutines === [[File:Subroutine in Excel.PNG|thumb|400px|Subroutine in [[Microsoft Excel]] writes values calculated using ''x'' into ''y''.]] Functions themselves cannot write into the worksheet but simply return their evaluation. However, in Microsoft Excel, [[subroutine]]s can write values or text found within the subroutine directly to the spreadsheet. The figure shows the Visual Basic code for a subroutine that reads each member of the named column variable ''x'', calculates its square, and writes this value into the corresponding element of named column variable ''y''. The ''y'' column contains no formula because its values are calculated in the subroutine, not on the spreadsheet, and simply are written in. === Remote spreadsheet === Whenever a reference is made to a cell or group of cells that are not located within the current physical spreadsheet file, it is considered as accessing a "remote" spreadsheet. The contents of the referenced cell may be accessed either on the first reference with a manual update or more recently in the case of web-based spreadsheets, as a near real-time value with a specified automatic refresh interval. === Charts === [[File:Excel chart.PNG|thumb|300px|Graph made using Microsoft Excel]] Many spreadsheet applications permit [[chart]]s and [[Graph (data structure)|graphs]] (e.g., [[histogram]]s, [[pie chart]]s) to be generated from specified groups of cells that are dynamically re-built as cell contents change. The generated graphic component can either be embedded within the current sheet or added as a separate object. To create an Excel histogram, a formula based on the REPT function can be used.<ref>{{Cite web|url=https://www.xlsoffice.com/excel-functions/text-functions/rept-function-description-usage-syntax-examples-and-explanation/|title = REPT function: Description, Usage, Syntax, Examples and Explanation October 26, 2021 - Excel Office|date = 25 February 2019}}</ref> === Multi-dimensional spreadsheets === In the late 1980s and early 1990s, first [[Javelin Software]] and [[Lotus Improv]] appeared. Unlike models in a conventional spreadsheet, they utilized models built on objects called variables, not on data in cells of a report. These multi-dimensional spreadsheets enabled viewing data and [[algorithm]]s in various self-documenting ways, including simultaneous multiple synchronized views. For example, users of Javelin could move through the connections between variables on a diagram while seeing the logical roots and branches of each variable. This is an example of what is perhaps its primary contribution of the earlier Javelin—the concept of traceability of a user's logic or model structure through its twelve views. A complex model can be dissected and understood by others who had no role in its creation. In these programs, a [[time series]], or any variable, was an object in itself, not a collection of cells that happen to appear in a row or column. Variables could have many attributes, including complete awareness of their connections to all other variables, data references, and text and image notes. Calculations were performed on these objects, as opposed to a range of cells, so adding two-time series automatically aligns them in calendar time, or in a user-defined time frame. Data were independent of worksheets—variables, and therefore data, could not be destroyed by deleting a row, column, or entire worksheet. For instance, January's costs are subtracted from January's revenues, regardless of where or whether either appears in a worksheet. This permits actions later used in [[pivot table]]s, except that flexible manipulation of report tables, was but one of many capabilities supported by variables. Moreover, if costs were entered by week and revenues by month, the program could allocate or interpolate as appropriate. This object design enabled variables and whole models to reference each other with user-defined variable names and to perform multidimensional analysis and massive, but easily editable consolidations. Trapeze,<ref name="Trapeze">{{cite web|title=Trapeze|url=http://basalgangster.macgui.com/RetroMacComputing/The_Long_View/Entries/2011/3/26_Trapeze.html}}</ref> a spreadsheet on the Mac, went further and explicitly supported not just table columns, but also matrix operators. === Logical spreadsheets === Spreadsheets that have a formula language based upon [[logic]]al expressions, rather than [[arithmetic]] expressions are known as [[logical spreadsheet]]s. Such spreadsheets can be used to reason [[deductive reasoning|deductively]] about their cell values.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)