A spreadsheet is an example application that captures, analyzes, and shares tabular data sets. One example spreadsheet 100 is shown in
This disclosure relates to methods for editing a formula.
One aspect of the disclosed embodiments is a computer-implemented method for editing a formula. The method includes receiving a text string including formula information. The method further includes parsing the received text string and analyzing the parsed text string for formula errors while the text string is being received. In response to a formula error being detected in the analyzed text string, the method further includes generating a message pertaining to the formula error.
Another aspect of the disclosed embodiments is a computer-implemented method for editing a formula. The method includes receiving a text string including formula information. The method further includes parsing the received text string and analyzing the parsed text string for a formula while the text string is being received. In response to a formula being detected in the analyzed text string, the method further includes calculating at least one sub-value for the formula and generating a message pertaining to the at least one sub-value.
Another aspect of the disclosed embodiments is a computer-readable medium having processor-executable program instructions adapted to be executed to implement a method for editing a formula. The method includes receiving a text string including formula information. The method further includes parsing the received text string and analyzing the parsed text string for a formula while the text string is being received. In response to a formula being detected in the analyzed text string, the method further includes calculating at least one sub-value for the formula and generating a message pertaining to the at least one sub-value.
The detailed description makes reference to the accompanying drawings wherein like reference numerals refer to like parts throughout the several views, and wherein:
In the methods described here, an input device receives a text string including formula information. The text string received by the input device is displayed. While the text string is being received, a formula analyzer parses the text string and analyzes the parsed text string for a formula and for formula errors. When a formula error is detected in the analyzed text string, a message pertaining to the formula error is generated and displayed. When a formula is detected in the analyzed text string, a formula calculator calculates at least one sub-value in the formula. A message pertaining to at least one sub-value is also generated and displayed.
As described above,
When dealing with long, complicated formulas with many sub-parts, sub-portions, terms, or sub-values, editing and displaying results of the formula in a spreadsheet 100 can be difficult. This is especially the case for formulas that refer to other data in calculating a result. Automatic calculation of a formula after entering or editing a text string eliminates the need to manually request the spreadsheet program to calculate a result. However, conventional approaches require a user to exit the cell 104 so that the result of the formula in the cell 104 is calculated and displayed to the user.
A user editing a formula can enter part of the formula and then exit the cell 104 of the spreadsheet 100 so that the result based on the part of the formula is calculated and displayed to the user. When a user is constantly moving in and out of a cell 104 while editing the formula to check accuracy of each sub-part, the process can become cumbersome.
For especially complex formulas, a common practice is to split the formula across several cells, with one “master cell” pulling the sub-parts of the formula together using cell references. This is inefficient and cumbersome because this method requires time to set up the formula due to extraneous navigation between cells and human memory load for the user to remember which cells hold which sub-part of the formula.
The instructions can be stored in the memory 204 and implemented in one or more computer program products. Computer program products can be one or more modules of computer program instructions encoded on a computer-readable medium for execution by, or to control the operation of, the computer system 200. Memory 204 can store temporary variable or other intermediate information during execution of instructions executable by the processor 202.
The computer system 200 can further include a data storage device 206 coupled to the bus 208. The data storage device 206 stores information and instructions. An input/output module 210 can couple computer system 200 to various devices. The input/output module 210 can be any input/output module. Examples of input/output modules 210 include data ports such as universal serial bus (USB) ports. The input/output module 210 can connect to a communications module 212. Examples of communications modules 212 include networking interface cards, such as Ethernet cards and modems.
The input/output module 210 can also connect to a number of devices, such as an input device 214 and/or an output device 216. Examples of input devices 214 include a keyboard and a pointing device such as, for example, a mouse, by which a user 215 can provide input to the computer system 200. Examples of output devices 216 include display devices such as, for example, a liquid crystal display (LCD) monitor for displaying information to the user 215.
According to one aspect, the methods described here for editing a formula can be implemented using the computer system 200 in response to processor 202 executing one or more sequences of one or more instructions contained in memory 204. Another machine-readable medium, such as data storage device 206, can read such instructions into memory 204. Execution of the sequences of instructions contained in memory 204 can cause processor 202 to perform the described method steps.
The computing device 200 can take many forms such as a tablet, laptop, desktop, workstation, personal digital assistant, cellular telephone, smartphone, server, blade server, mainframe, or other device in communication with or having an input device 214, output device 216, and processing capability. The components shown here, their connections and relationships, and their functions, are meant to be examples, and are not meant to limit the method for editing a formula described and/or claimed in this document.
Referring now to
In
A formula can be composed of many spreadsheet functions or none at all. A formula can be created from numbers (e.g. “=5”), basic operators (e.g. “=5+4”), strings (e.g. “=“hello””), functions (e.g. “=SUM(1, 2)”) or combinations thereof (e.g. “=SUM(1, 2+3, SUM(4, 5, 6))”). Once spreadsheet functions are identified, the formula analyzer 202A can attempt to calculate sub-values for various sub-portions, or terms, that make up the spreadsheet functions. Some sub-values are able to be calculated while other sub-values cannot be calculated due to some formula error.
Examples of formula errors can include an incomplete formula, a missing character within the formula, unexpected text within a function, a missing function, and the like. If a formula error is found by the formula analyzer 202A, a message, or hint, can be displayed to the user regarding a method to fix the formula error. In certain circumstances, the sub-portion might contain more than one formula error. Because displaying all error hints at the same time could be distracting to the user, one formula error at a time can be displayed. This implementation can include a prioritization of formula errors, such that the formula analyzer 202A can decide the hierarchy of formula errors to display.
In some implementations, if there is a formula error, the formula error can be highlighted (e.g., by underlining) The hint about how to fix the formula error can be displayed if the user hovers the pointer over the highlighted error. When the display of the message, or hint, is based on the pointer's proximity to the formula error, the formula error can be shown immediately after a sub-portion, or term, of the spreadsheet function is entered, since the pointer will be adjacent to that sub-portion just entered.
In some implementations, the sub-value versus formula error calculation can be performed for all potential sub-values. The calculation does not stop when a formula error is encountered unless the formula error is a global error that prevents identification and calculation of a sub-value (e.g., a missing parenthesis). In these implementations, some sub-values can resolve to a value, while others might encounter a formula error. The attempted sub-value calculations that encounter a formula error can be underlined, and those that resolve to a value can have the value displayed in a message proximate to the sub-value when hovered over by a pointer or when in proximity to a cursor.
As another example, the following formula has at least two formula errors: “=a+SUM(2,”. First, “a” is not a valid value for addition (it refers to an entire column). Second, there is an opening parenthesis “(” but not a closing parenthesis “)” in the formula. In this example, the second formula error can be displayed first based on proximity because the cursor will be located after the final comma, adjacent to the second formula error. If the user hovers the pointer over the “a,” then the first formula error would be displayed. In this example, there can also be a third formula error based on the comma, indicating a missing parameter in the SUM function. One way to avoid overloading the user is to establish an order to the formula errors, with only one formula error displayed at a time.
Since displaying a formula error immediately upon entering the text string could distract the user, in one implementation a delay can be added. For example, without a delay, as soon as the user starts writing the function “SUM(”, the “No Final Parentheses” error would show. The delay can be designed to give the user enough time to be able to enter additional detail of the formula before an error message is displayed, if not the entire formula. When feasible, the error hint can be localized to the portion, or term, of the text string that the formula error affects. Because sub-parts, terms, and sub-portions are recalculated continuously, formula errors are identified quickly and, when feasible, localized.
Referring to
Referring to
As another example, consider the formula “=1+2/3*(4−2).” As with the previous examples, hovering over “(4−2)” can produce a message with the result “2.” However, it is not possible to calculate the sub-value of “3*(4” in this formula, because the order of operations precludes the sub-value from being used in the final calculation. In this way, only logical sub-values based on proper order of operations are displayed. Also, hovering over “1” would show the entire formula value since the addition is only calculable after the division, multiplication, and parentheses-enclosed subtraction are calculated based on order of operations.
In the methods for editing formulas described here, order of operations can be applied to calculate as many sub-portions or terms of a formula as possible, even in the presence of errors. Once each sub-portion or term of a formula is calculated, the resulting values can be combined to calculate sub-values, or results, which can be sent as messages to a display. Some of the sub-values will fail to be calculated because of errors. Failed calculations can direct the formula analyzer 202A to determine the localization of formula errors.
In step 1014, the received text string can be parsed. Parsing the text string can include analyzing the text string to determine structure, for example, whether alphanumeric text, a numeric value, or a formula is present within the text string. In step 1015, the text string can be analyzed to identify any formula errors. In decision block 1016, the text string is reviewed to determine if any formula errors have been detected. If no formula errors are detected, the method returns to step 1010, awaiting additional text strings or continuation of the current text string. If a formula error is detected, a message can be generated pertaining to the formula error in step 1018. Once the error message is generated, the error message can be sent to the display in step 1020, and the process ends.
The error message can be displayed at the same time that the text string is being displayed. The error message can also be generated and sent to the display in response to the selection of a term, or portion, within the analyzed text string. For example, a term can be selected when a cursor is located within or proximate to the text string, a pointer is hovering over a term or portion of the text string, or a delimiter, such as a comma or parenthesis, is present within a term or portion of the text string. The error message can also include a hint regarding a suggested correction for the formula error. Example hints include those shown in
In step 1114, the received text string can be parsed. Parsing the text string can include analyzing the text string to determine structure, for example, whether alphanumeric text, a numeric value, or a formula is present within the text string. In step 1115, the text string can be analyzed to identify a formula present in the text string. In decision block 1116, the text string is reviewed to determine if a formula is detected. If no formula is detected, no sub-values are calculated, and the method returns to step 1110 awaiting additional text strings or continuation of the current text string. If at least part of a formula is detected, at least one sub-value can be calculated in step 1118. Additionally, if a complete formula is detected, e.g. a formula without missing parts or formula errors, the complete result of the formula can also be calculated. A message can be generated pertaining to a sub-value or complete result of the formula in step 1120. Once the message is generated, the message can be sent to the display in step 1122, and the process ends.
The message pertaining to a sub-value or complete result can be displayed at the same time that the text string is being displayed. The message can also be generated and sent to the display in response to the selection of a term, or portion, within the analyzed text string. For example, a term can be selected when a cursor is located within or proximate to the text string, a pointer is hovering over a term or portion of the text string, or a delimiter, such as a comma or parenthesis, is present within a term or portion of the text string. The message can include the result of a sub-value or the result of the complete formula. Example results include those shown in
With these methods for editing a formula, it is possible to enter a complete, complex formula into one cell all at one time, while still allowing for examination of the sub-parts of the formula in isolation. The sub-parts, sub-portions, or terms can be calculated based on order of operations and the result of each sub-part or term can be viewed either in the form of a result or a formula error. Giving a user the ability to review the sub-parts of a formula using order of operations and sub-part results in this way can help the user identify semantic problems that are causing incorrect evaluations.
When used herein, the term spreadsheet includes other computer applications having similar functionality. Other types of software that also enter formulas or otherwise check the content of the text strings against rules could implement the methods described here without departing from the scope and spirit of the examples. Examples include equation editors, calculator software, word processors (which might display a formula as part of text content), source code editors, and the like.
In addition, the implementations described herein are not inherently related to any particular hardware or other apparatus. The methods for formula editing can be controlled through either hardware or through computer programs installed in computer storage and executed by the processors of servers. One or more processors in a multi-processing arrangement also can be employed to execute the sequences of instructions.
When embodied as hardware, the hardware can be specially constructed for the required purposes or can include a general-purpose computer selectively activated or reconfigured by a computer program stored on a computer-readable medium. In addition, the implementations described here are not limited to any particular programming language.
The techniques can be implemented using a single computer or a network of computers, including cloud-based computing. The computers can be server-class computers including one or more high-performance central processing units (CPUs), memory such as main memory and computer-readable persistent storage, network interfaces, peripheral interfaces, and other well-known components.
The computers can run an operating system. Various types of operating systems and computers can be used, and it is expected that more powerful computers developed in the future can be configured in accordance with the implementations described here.
The term computer-readable media includes computer-storage media. Examples include magnetic-storage devices such as hard disks, floppy disks, and magnetic tape; optical disks such as compact disks (CD) and digital-versatile disks (DVD); magnetic-storage devices such as digital tapes, floppy disks, and magneto-resistive-random-access memory (MRAM); non-volatile memory such as read-only memory (ROM), erasable-programmable-read-only memory (EPROMs), and electrically-erasable-programmable-read-only memory (EEPROMs); volatile memory such as random-access memory (RAM), dynamic random access memory (DRAM), ferroelectric-random-access memory (FeRAM), and static-random-access memory (SRAM); or any other type of media suitable for storing electronic instructions.
Furthermore, at times arrangements of operations have been referred to as modules or by functional names, without loss of generality. The term ‘module’ refers to computational logic for providing the specified functionality. The division of functionality between components, the naming of modules, components, attributes, data structures or any other programming or structural aspect is merely exemplary, and not mandatory or significant. In addition, other implementations can lack modules and/or distribute the described functionality among modules in a different manner. Functions performed by a component can instead be performed by multiple components, and functions performed by multiple components can instead be performed by a single component.
Number | Name | Date | Kind |
---|---|---|---|
5307484 | Baker et al. | Apr 1994 | A |
5345516 | Boyer et al. | Sep 1994 | A |
5416895 | Anderson et al. | May 1995 | A |
5600584 | Schlafly | Feb 1997 | A |
5603021 | Spencer et al. | Feb 1997 | A |
5706449 | Liu et al. | Jan 1998 | A |
5809317 | Kogan et al. | Sep 1998 | A |
5842180 | Khanna | Nov 1998 | A |
5910802 | Shields et al. | Jun 1999 | A |
5950168 | Simborg et al. | Sep 1999 | A |
6055550 | Wallack | Apr 2000 | A |
6204846 | Little et al. | Mar 2001 | B1 |
6205453 | Tucker et al. | Mar 2001 | B1 |
6317758 | Madsen et al. | Nov 2001 | B1 |
6430574 | Stead | Aug 2002 | B1 |
6437812 | Giles et al. | Aug 2002 | B1 |
6711715 | Grealish | Mar 2004 | B1 |
6734883 | Wynn et al. | May 2004 | B1 |
6738084 | Kelley et al. | May 2004 | B1 |
6778192 | Arbab et al. | Aug 2004 | B2 |
6828988 | Hudson et al. | Dec 2004 | B2 |
6978443 | Flanagan | Dec 2005 | B2 |
6988241 | Guttman | Jan 2006 | B1 |
7009609 | Miyadai | Mar 2006 | B2 |
7101779 | Vaartstra et al. | Sep 2006 | B2 |
7117430 | Maguire, III et al. | Oct 2006 | B2 |
7117450 | Chaudhri | Oct 2006 | B1 |
7266763 | Peyton-Jones et al. | Sep 2007 | B2 |
7275207 | Aureglia et al. | Sep 2007 | B2 |
7546523 | Aureglia et al. | Jun 2009 | B2 |
7752148 | Yu et al. | Jul 2010 | B2 |
8130205 | Forstall et al. | Mar 2012 | B2 |
20020023105 | Wisniewski | Feb 2002 | A1 |
20020143809 | Bennett | Oct 2002 | A1 |
20020169799 | Voshell | Nov 2002 | A1 |
20020186252 | Himmel et al. | Dec 2002 | A1 |
20020194095 | Koren | Dec 2002 | A1 |
20030188257 | Aureglia et al. | Oct 2003 | A1 |
20030226105 | Waldau | Dec 2003 | A1 |
20040107277 | Levesque et al. | Jun 2004 | A1 |
20050091604 | Davis | Apr 2005 | A1 |
20050183017 | Cain | Aug 2005 | A1 |
20050210403 | Satanek | Sep 2005 | A1 |
20060036939 | Hobbs et al. | Feb 2006 | A1 |
20060070002 | Guido et al. | Mar 2006 | A1 |
20060107226 | Matthews et al. | May 2006 | A1 |
20060117051 | Chin | Jun 2006 | A1 |
20060184901 | Dietz | Aug 2006 | A1 |
20060224946 | Barrett et al. | Oct 2006 | A1 |
20070016872 | Cummins et al. | Jan 2007 | A1 |
20070033518 | Kenna et al. | Feb 2007 | A1 |
20070083541 | Fraleigh et al. | Apr 2007 | A1 |
20070130503 | Voshell | Jun 2007 | A1 |
20070153897 | Yan | Jul 2007 | A1 |
20070234195 | Wells | Oct 2007 | A1 |
20080028340 | Davis | Jan 2008 | A1 |
20080155464 | Jones et al. | Jun 2008 | A1 |
20080229184 | Prish et al. | Sep 2008 | A1 |
20080238938 | Eklund et al. | Oct 2008 | A1 |
20090158139 | Morris et al. | Jun 2009 | A1 |
20090187816 | Aureglia et al. | Jul 2009 | A1 |
20090287673 | Chronister et al. | Nov 2009 | A1 |
20090325607 | Conway et al. | Dec 2009 | A1 |
20110148789 | Kim et al. | Jun 2011 | A1 |
20110283227 | Moore et al. | Nov 2011 | A1 |
Entry |
---|
Clark, iWork'09: The Missing Manual, O'Reilly Media, Inc., Apr. 24, 2009, Chapter 20, “Using Formulas”, 44 pages. |
Abraham et al. (“Abraham”), “How to Communicate Unit Error Messages in Spreadsheets”, First Workshop on EndUser Software Engineering (WEUSE I), May 21, 2005, Saint Louis, Missouri, USA, p. 1-5. |
Auto-Hide the Taskbar in Windows XP, Apr. 12, 2006, 3 pages, http://www.xp-tips.com/auto-hide-taskbar-.html. |
Bankoski et al. “VP8 Data Format and Decoding Guide; draft-bankoski-vp8-bitstream-02” Network Working Group. Internet-Draft, May 18, 2011, 288 pp. |
Doing it Right: skipping the iPhone url bar, Aug. 5, 2010, 4 pages, http://remysharp.com/2010/08/05/doing-it-right-skipping-the-iphone-url-bar. |
Mozilla, “Introduction to Video Coding Part 1: Transform Coding”, Video Compression Overview, Mar. 2012, 171 pp. |
Product Feature Tour, Visual Studio Style, Auto Hide Control Bars, Mar. 9, 2004, 2 pages, http://www.bcgsoft.com/featuretour/tour156.htm. |
Teknomo, K. “How to use MS Excel Iterations”, 2006, pp. 1-5. |
Pearson, “The Indirect Function”, 1999, pp. 1-2. |
Actuarial Outpost, Discussion Forum “Excel: Conditional Tab Colors,” http://www.actuarialoutpost.com/actuarial—discussion—forum/showthread.php?t=220776, Jul. 2011. 5 Pages. |
David Pogue, “iPhone: The Missing Manual, Forth Edition,” Aug. 2010, 450 pages. |
Microsoft Excel 2003-2013, “Named Ranges in Excel” 5 pages. |
Microsoft Excell 2003, “Creating Custom functions” 6 pages. |
Wayne Pan, “JavaScript Pull to Refresh,” Jul. 2010, 3 pages. |
StackOverflow, “Are there such things as variables within an Excel formula?” 2009, 3 pages. |