A method, device, computer storage medium and terminal for editing formula
By parsing and replacing parameters in spreadsheet calculation formulas, new calculation formulas are generated, which solves the problem of low editing efficiency of complex formulas and achieves a more efficient and simplified editing process.
Patent Information
- Application Number
- CN201910708812.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-01
- Publication Date
- 2024-08-13
- Estimated Expiration
- 2039-08-01
AI Technical Summary
In spreadsheets, editing complex calculation formulas is inefficient and error-prone. Existing technologies such as copy modification and macro customization require users to have advanced programming knowledge and are complex to operate.
Obtain relevant parameters by parsing the calculation formula, set parameters that meet the preset conditions as parameters to be adjusted, replace the target parameters with parameters to be adjusted, generate new calculation formulas, including references and constants, and use the interactive interface to display and process parameter replacement .
It improves the editing efficiency of calculation formulas in spreadsheets, reduces the error rate, simplifies the operation process, and reduces the need for advanced programming knowledge.
Smart Images

Figure CN112329397B_ABST
Abstract
Description
Technical Field
[0001] This article relates to but is not limited to office application technology, and in particular to a method, device, computer storage medium and terminal for editing formulas. Background Art
[0002] When using a spreadsheet, complex calculation formulas are often used. In order to reduce the time consumption of formula editing, there are currently two processing methods: one is to copy the existing calculation formula, adjust and modify the copied calculation formula, and obtain the formula required for the current calculation; taking the calculation of fruit sales as an example, assuming that the spreadsheet contains the formula for calculating the sales of apples in three branches: F(x) = SUMIFS (the first branch order table [quantity], the first branch order table [product type], "apple", the first branch order table [order status], "settled") + SUMIFS (the second branch order table [quantity], the second branch order table [product type], "apple", the second branch order table [order status], "settled") + SUMIFS (the third branch order table [quantity], the third branch order table [product type], "apple", the third branch order table [order status], "settled"); when it is necessary to calculate the sales of Sydney pears in the three branches, the relevant technology will copy the formula for calculating the sales of apples to the cell for counting the sales of Sydney pears, and then replace "apple" in the formula with "Snow pear" by manual modification. Another way is to customize the formula through macros.
[0003] As for the method of modifying formulas by copying existing calculation formulas, since calculation formulas are generally complex and involve multiple parts, the formula adjustment efficiency is low and errors are prone to occur. Customizing formulas through macros requires users to master VBA (a macro language of Visual Basic, a programming language developed by Microsoft to perform common automation tasks in its desktop applications), which is difficult to operate. In addition, because macros are used, other users need to allow the macro to run in order to run the formula normally, which increases the complexity of the reader's operation.
[0004] In summary, how to improve the editing efficiency of spreadsheet calculation formulas has become a problem to be solved. Summary of the invention
[0005] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0006] The embodiments of the present invention provide a method, device, computer storage medium and terminal for editing formulas, which can improve the editing efficiency of calculation formulas in electronic spreadsheets.
[0007] An embodiment of the present invention provides a method for editing a formula, comprising:
[0008] Analyze the first operation formula to obtain relevant parameters in the first operation formula;
[0009] Set the relevant parameters that meet the preset conditions as parameters to be adjusted;
[0010] The received target parameter is replaced by the parameter to be adjusted to generate a second operation formula for the second cell operation;
[0011] The related parameters include: references and / or constants.
[0012] In an exemplary embodiment, after setting the relevant parameters that meet the preset conditions as parameters to be adjusted, the method further includes:
[0013] The first calculation formula for completing the setting of the parameter to be adjusted is stored as a function with the parameter to be adjusted as a variable.
[0014] In an exemplary embodiment, replacing the received target parameter with the parameter to be adjusted includes:
[0015] The received target function is replaced by the parameters to be adjusted in the function through the stored variables of the function.
[0016] In an exemplary embodiment, before setting the relevant parameters that meet the preset conditions as parameters to be adjusted, the method further includes:
[0017] The first calculation formula is loaded on a preset interactive interface, and the related parameters set as the parameters to be adjusted are displayed and differentiated according to a preset display strategy.
[0018] In an exemplary embodiment, setting the relevant parameters that meet the preset conditions as parameters to be adjusted includes:
[0019] Counting the occurrence frequencies of each relevant parameter in the first operation formula;
[0020] The relevant parameters whose occurrence frequency is greater than the preset frequency threshold are set as parameters to be adjusted.
[0021] In an exemplary embodiment, replacing the received target parameter with the parameter to be adjusted includes:
[0022] Determine the position information of each relevant parameter set as the parameter to be adjusted in the first operation formula;
[0023] According to the determined position information, the received target parameter is replaced with the parameter to be adjusted.
[0024] In an exemplary embodiment, when the relevant parameters satisfying the preset conditions are set as parameters to be adjusted, the method further includes performing one or more of the following processes:
[0025] According to the received first external instruction, cancel setting one or more related parameters as the parameters to be adjusted;
[0026] According to the received second external instruction, one or more related parameters that are not set as the parameters to be adjusted are set as the parameters to be adjusted.
[0027] On the other hand, an embodiment of the present invention further provides a device for editing a formula, comprising: a parsing unit, a configuration unit and a generation unit; wherein,
[0028] The parsing unit is used to: parse the first operation formula to obtain relevant parameters in the first operation formula;
[0029] The configuration unit is used to: set relevant parameters that meet preset conditions as parameters to be adjusted;
[0030] The generating unit is used to: replace the received target parameter with the parameter to be adjusted, and generate a second operation formula for the second cell operation;
[0031] The related parameters include: references and / or constants.
[0032] On the other hand, an embodiment of the present invention further provides a computer storage medium, in which computer executable instructions are stored, and the computer executable instructions are used to execute the above-mentioned method for editing formulas.
[0033] In another aspect, an embodiment of the present invention further provides a terminal, comprising: a memory and a processor; wherein:
[0034] The processor is configured to execute program instructions in the memory;
[0035] The program instructions are read by the processor to execute the above method of editing the formula.
[0036] Compared with the related art, the technical solution of the present application includes: obtaining relevant parameters in the first operation formula; setting relevant parameters that meet the preset conditions as parameters to be adjusted; replacing the received target parameters with the parameters to be adjusted to generate a second operation formula for the second cell operation; wherein the relevant parameters include: references and / or constants. The embodiment of the present invention realizes the generation of the second operation formula by replacing the target parameters with the set parameters to be adjusted, thereby improving the editing efficiency of the operation formula in the electronic spreadsheet.
[0037] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.
[0039] Figure 1 A flowchart of a method for editing a formula according to an embodiment of the present invention;
[0040] Figure 2 A schematic diagram showing an interactive interface according to an embodiment of the present invention;
[0041] Figure 3 A schematic diagram of adjusting a formula according to an embodiment of the present invention;
[0042] Figure 4 The present invention is a structural block diagram of a device for editing formulas according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention more clear, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.
[0044] The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a sequence different from that shown here.
[0045] Figure 1 Flow chart of the method for editing a formula according to an embodiment of the present invention, as shown in FIG. Figure 1 As shown, including:
[0046] Step 101: parse the first operation formula to obtain relevant parameters in the first operation formula;
[0047] The relevant parameters include: references and / or constants. Taking the formula for calculating the apple sales volume of three branches in the background technology spreadsheet as an example, the relevant parameter content obtained is shown in Table 1, including references and constants. When obtaining the relevant parameters, the embodiment of the present invention counts the occurrence frequency of the relevant parameters:
[0048] apple 3 Settled 3 First branch order form [quantity] 1 First branch order form [product type] 1 First branch order table [order status] 1 Second branch order form [quantity] 1 Second branch order form [product type] 1 Second branch order table [order status] 1 Third branch order form [quantity] 1 Third branch order form [product type] 1 Third branch order table [order status] 1
[0049] Table 1
[0050] In an exemplary embodiment, before parsing the first operation formula, the method of the embodiment of the present invention includes: obtaining the first operation formula in the first cell.
[0051] It should be noted that the method for parsing the relevant parameters includes: according to the definition of the relevant parameters, using a text analysis method to obtain the relevant parameters in the first operation formula; the text analysis method includes an existing information analysis method in the relevant technology.
[0052] Step 102: setting relevant parameters that meet preset conditions as parameters to be adjusted;
[0053] Here, setting the relevant parameters as parameters to be adjusted includes: replacing the relevant parameters with the parameters to be adjusted; for example, the first operation formula includes the relevant parameters to be configured as parameters to be adjusted: apples and settled; configuring apples and settled as parameters to be adjusted may include: replacing apples in the first operation formula with parameter 1, and replacing settled with parameter 2;
[0054] In an exemplary embodiment, setting the relevant parameters that meet the preset conditions as parameters to be adjusted includes:
[0055] Counting the occurrence frequencies of each relevant parameter in the first operation formula;
[0056] The relevant parameters whose occurrence frequency is greater than the preset frequency threshold are set as parameters to be adjusted.
[0057] It should be noted that the frequency threshold can be determined and adjusted by those skilled in the art according to the complexity of the formula, the number of related parameters involved, and the calculation content of the second cell; for example, the frequency threshold can be set to be greater than or equal to 2.
[0058] Step 103: Replace the received target parameter with the parameter to be adjusted to generate a second calculation formula for a second cell operation.
[0059] In an exemplary embodiment, replacing the received target parameter with the parameter to be adjusted includes:
[0060] Determine the position information of each relevant parameter set as the parameter to be adjusted in the first operation formula;
[0061] According to the determined position information, the received target parameter is replaced with the parameter to be adjusted.
[0062] It should be noted that the position information may include: the relative position of the parameter to be adjusted determined according to the text analysis method in the formula after the relevant parameter is set as the parameter to be adjusted; for example, if the apples in the formula for calculating the apple sales volume of three branches are set as the parameter to be adjusted, the position information may be: the position of each apple determined according to the text analysis method in the quotation marks after "[product type]," in the calculation formula; the position information may also be the byte sorting information of the apple in the calculation formula, that is, the byte number of the relevant parameter apple in the calculation formula.
[0063] In an exemplary embodiment, after setting the relevant parameters that meet the preset conditions as parameters to be adjusted, the method further includes:
[0064] The first calculation formula for completing the setting of the parameter to be adjusted is stored as a function with the parameter to be adjusted as a variable.
[0065] In an exemplary embodiment, replacing the received target parameter with the parameter to be adjusted includes:
[0066] The received target function is replaced by the parameters to be adjusted in the function through the stored variables of the function.
[0067] In an exemplary embodiment, before configuring one or more relevant parameters in the first operation formula as corresponding parameters to be adjusted, the method of the embodiment of the present invention further includes:
[0068] The first calculation formula is loaded on a preset interactive interface, and the related parameters configured as parameters to be adjusted are distinguished and displayed according to a preset display strategy.
[0069] In an exemplary embodiment, displaying the parameters to be adjusted in a differentiated manner includes: displaying different parameters to be adjusted using different display settings.
[0070] Figure 2 Schematic diagram of the interactive interface display of the embodiment of the present invention, such as Figure 2 As shown, the first calculation formula is loaded and displayed in the interactive interface, and the apples and settled items that need to be configured as parameters to be adjusted are marked and displayed with different icons (apples are marked with a solid underline, and settled items are marked with a dotted line). Figure 3 Schematic diagram of formula adjustment according to an embodiment of the present invention, such as Figure 3 As shown, after establishing association links for the parameters to be adjusted, the embodiment of the present invention stores the pending calculation formula as a function, and then sets an input box for inputting the target parameter in the interactive interface to achieve the adjustment of replacing the parameter to be adjusted with the target parameter, see Figure 3The pending calculation formula includes parameters to be adjusted: parameter 1 and parameter 2. The pending calculation formula is given a corresponding name according to the calculation function (for example, sales statistics function). The parameters to be adjusted: parameter 1 and parameter 2, as well as an input box for entering the target parameter, are also displayed on the interactive interface. After entering the target parameter 1 in the input box after parameter 1, parameter 1 in the pending calculation formula is replaced with target parameter 1 according to the associated link; after entering the target parameter 2 in the input box after parameter 2, parameter 2 in the pending calculation formula is replaced with target parameter 2 according to the associated link. It should be noted that the pending calculation formula and the names of the parameters to be adjusted on the interactive interface can be edited and adjusted by the user according to the function of the calculation formula and user habits. You can also add annotations to the relevant content on the interactive interface.
[0071] In an exemplary embodiment, when the relevant parameters satisfying the preset conditions are set as parameters to be adjusted, the method further includes performing one or more of the following processes:
[0072] According to the received first external instruction, cancel setting one or more related parameters as the parameters to be adjusted;
[0073] According to the received second external instruction, one or more related parameters that are not set as the parameters to be adjusted are set as the parameters to be adjusted.
[0074] In an exemplary embodiment, cancelling the configuration of relevant parameters as parameters to be adjusted, and configuring relevant parameters that are not configured as parameters to be adjusted as parameters to be adjusted, can both be processed by a method including popping up a menu bar by right-clicking a mouse, or by other interactive methods. Taking the menu bar that pops up by right-clicking a mouse as an example: when cancelling the configuration of relevant parameters as parameters to be adjusted, a menu item for canceling the configuration can be popped up after the relevant parameter is selected; when configuring relevant parameters that are not configured as parameters to be adjusted as parameters to be adjusted, a menu item for configuring the parameters to be adjusted can be popped up after the relevant parameter is selected.
[0075] In an exemplary embodiment, the embodiment of the present invention can refer to relevant technologies to import and export operation formulas for setting parameters to be adjusted; it can also cancel the editing process of the operation formula for setting parameters to be adjusted; in addition, the embodiment of the present invention can perform formula editing process on the operation formula for setting parameters to be adjusted itself, and after obtaining the second operation formula, the position of the second operation formula obtained can be edited and adjusted within the second cell.
[0076] Compared with the related art, the technical solution of the present application includes: obtaining relevant parameters in the first operation formula; setting relevant parameters that meet the preset conditions as parameters to be adjusted; replacing the received target parameters with the parameters to be adjusted to generate a second operation formula for the second cell operation; wherein the relevant parameters include: references and / or constants. The embodiment of the present invention realizes the generation of the second operation formula by replacing the target parameters with the set parameters to be adjusted, thereby improving the editing efficiency of the operation formula in the electronic spreadsheet.
[0077] Figure 4 The structural block diagram of the apparatus for editing formulas according to the embodiment of the present invention is as follows: Figure 4 As shown, it includes: a parsing unit, a configuration unit and a generation unit; wherein,
[0078] The parsing unit is used to: parse the first operation formula to obtain relevant parameters in the first operation formula;
[0079] The configuration unit is used to: set relevant parameters that meet preset conditions as parameters to be adjusted;
[0080] The generating unit is used to: replace the received target parameter with the parameter to be adjusted, and generate a second operation formula for the second cell operation;
[0081] The related parameters include: references and / or constants.
[0082] In an exemplary embodiment, the device of the embodiment of the present invention further includes a storage unit, which is used to:
[0083] The first calculation formula for completing the setting of the parameter to be adjusted is stored as a function with the parameter to be adjusted as a variable.
[0084] In an exemplary embodiment, the generating unit is used to replace the received target parameter with the parameter to be adjusted, including:
[0085] The received target function is replaced by the parameters to be adjusted in the function through the stored variables of the function.
[0086] In an exemplary embodiment, the embodiment of the present invention further includes a distinguishing display unit, which is used to:
[0087] The first calculation formula is loaded on a preset interactive interface, and the related parameters set as the parameters to be adjusted are displayed and differentiated according to a preset display strategy.
[0088] In an exemplary embodiment, the configuration unit is specifically configured to:
[0089] Counting the occurrence frequencies of each relevant parameter in the first operation formula;
[0090] The relevant parameters whose occurrence frequency is greater than the preset frequency threshold are set as parameters to be adjusted.
[0091] In an exemplary embodiment, the generating unit is used to replace the received target parameter with the parameter to be adjusted, including:
[0092] Determine the position information of each relevant parameter set as the parameter to be adjusted in the first operation formula;
[0093] According to the determined position information, the received target parameter is replaced with the parameter to be adjusted.
[0094] In an exemplary embodiment, the configuration unit is further configured to:
[0095] According to the received first external instruction, cancel setting one or more related parameters as the parameters to be adjusted;
[0096] According to the received second external instruction, one or more related parameters that are not set as the parameters to be adjusted are set as the parameters to be adjusted.
[0097] An embodiment of the present invention further provides a computer storage medium, in which computer executable instructions are stored. The computer executable instructions are used to execute the above-mentioned method for editing a formula.
[0098] The embodiment of the present invention further provides a terminal, comprising: a memory and a processor; wherein:
[0099] The processor is configured to execute program instructions in the memory;
[0100] The program instructions are read by the processor to execute the above method of editing the formula.
[0101] “A person skilled in the art will appreciate that all or some of the steps, systems, and functional modules / units in the above disclosed methods may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transient medium). As is known in the art, As is well known to those skilled in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those skilled in the art, communication media typically contains computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media. "
Claims
1. A method for editing a formula, comprising: Parsing the first operation formula to obtain relevant parameters in the first operation formula; wherein the relevant parameters include: references and / or constants; Set the relevant parameters that meet the preset conditions as parameters to be adjusted; storing a first calculation formula for completing the setting of the parameter to be adjusted as a function with the parameter to be adjusted as a variable; For the function, the parameter to be adjusted is replaced with the received target parameter to generate a second operation formula for the second cell operation.
2. The method according to claim 1, characterized in that: The step of replacing the to-be-adjusted parameter with the received target parameter includes: Receive target parameters through an interactive interface; and replace the parameters to be adjusted in the function with the received target parameters.
3. The method according to claim 1, characterized in that Before setting the relevant parameters that meet the preset conditions as parameters to be adjusted, the method further includes: The first calculation formula is loaded on a preset interactive interface, and the related parameters set as the parameters to be adjusted are displayed and differentiated according to a preset display strategy.
4. The method according to claim 1, characterized in that: The step of setting the relevant parameters that meet the preset conditions as the parameters to be adjusted includes: Counting the occurrence frequencies of each relevant parameter in the first operation formula; The relevant parameters whose occurrence frequency is greater than the preset frequency threshold are set as parameters to be adjusted.
5. The method according to claim 1, 3 or 4, characterized in that: The step of replacing the to-be-adjusted parameter with the received target parameter includes: Determine the position information of each relevant parameter set as the parameter to be adjusted in the first operation formula; According to the determined position information, the parameter to be adjusted in the function is replaced with the received target parameter.
6. The method according to any one of claims 1 to 4, characterized in that: When the relevant parameters satisfying the preset conditions are set as parameters to be adjusted, the method further includes performing at least one of the following processes: According to the received first external instruction, cancel setting of at least one related parameter as the parameter to be adjusted; According to the received second external instruction, at least one related parameter that is not set as the parameter to be adjusted is set as the parameter to be adjusted.
7. A device for editing a formula, comprising: parsing unit, configuration unit, storage unit and generation unit; wherein, The parsing unit is used to: parse the first operation formula to obtain relevant parameters in the first operation formula; wherein the relevant parameters include: references and / or constants; The configuration unit is used to: set relevant parameters that meet preset conditions as parameters to be adjusted; The storage unit is used to: store the first operation formula for completing the setting of the parameter to be adjusted as a function with the parameter to be adjusted as a variable; The generating unit is used for: for the function, replacing the parameter to be adjusted therein with the received target parameter, and generating a second operation formula for the second cell operation.
8. A computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method for editing a formula according to any one of claims 1 to 6.
9. A terminal, comprising: A memory and a processor; wherein, The processor is configured to execute program instructions in the memory; The program instructions are read by a processor to execute the method for editing a formula according to any one of claims 1 to 6.
Citation Information
Patent Citations
Short message configuration method, apparatus and device, and readable storage medium
CN109660960A
