[Libreoffice-commits] help.git: source/text

Olivier Hallot (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 6 16:13:24 UTC 2019


 source/text/scalc/01/04060106.xhp                   |    4 +--
 source/text/scalc/guide/numbers_text.xhp            |   24 ++++++++++++--------
 source/text/shared/optionen/detailedcalculation.xhp |   23 +++++++++++++++----
 3 files changed, 35 insertions(+), 16 deletions(-)

New commits:
commit b2a9c3b29c29c417574890b27783da777702cabf
Author:     Olivier Hallot <olivier.hallot at libreoffice.org>
AuthorDate: Wed Sep 4 12:21:10 2019 -0300
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Fri Sep 6 18:13:02 2019 +0200

    tdf#42990 Different handling of Text Cells in Calc
    
    Change-Id: I96d54394fc4191ae80f593040b2b870e8a6e9e39
    Reviewed-on: https://gerrit.libreoffice.org/78612
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/source/text/scalc/01/04060106.xhp b/source/text/scalc/01/04060106.xhp
index 68631cebc..c134e8dbb 100644
--- a/source/text/scalc/01/04060106.xhp
+++ b/source/text/scalc/01/04060106.xhp
@@ -1137,8 +1137,8 @@
 
 <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
 <paragraph id="par_id3163656" role="code" xml-lang="en-US">SUM(Number1; Number2; ...; Number30)</paragraph>
-<paragraph id="par_id3163671" role="paragraph" xml-lang="en-US"><emph>Number 1 to Number 30</emph> are up to 30 arguments whose sum is to be calculated.</paragraph>
-
+<paragraph id="par_id3163671" role="paragraph" xml-lang="en-US"><emph>Number1 to Number30</emph> are up to 30 arguments, either cells or ranges, whose sum is to be calculated.</paragraph>
+<tip id="par_id151567608802604">SUM ignores any text or empty cell within a range or array. If you suspect wrong results of the SUM function, look for text in the data ranges. Use the <link href="text/scalc/01/03080000.xhp" name="value highllight">value highlighting</link> feature to highlight the text contents in the range that may represent a number.</tip>
 <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
 <paragraph id="par_id3163704" role="paragraph" xml-lang="en-US">If you enter the numbers <item type="input">2</item>; <item type="input">3 </item>and <item type="input">4</item> in the Number 1; 2 and 3 text boxes, 9 will be returned as the result.</paragraph>
 <paragraph id="par_id3151740" role="paragraph" xml-lang="en-US"><item type="input">=SUM(A1;A3;B5)</item> calculates the sum of the three cells. <item type="input">=SUM (A1:E10)</item> calculates the sum of all cells in the A1 to E10 cell range.</paragraph>
diff --git a/source/text/scalc/guide/numbers_text.xhp b/source/text/scalc/guide/numbers_text.xhp
index 8d46c4d46..0cf821b14 100644
--- a/source/text/scalc/guide/numbers_text.xhp
+++ b/source/text/scalc/guide/numbers_text.xhp
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <helpdocument version="1.0">
-	
+
 <!--
  * This file is part of the LibreOffice project.
  *
@@ -18,8 +18,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  -->
- 
-	
+
+
 <meta>
       <topic id="textscalcguidenumbers_textxml" indexer="include" status="PUBLISH">
          <title xml-lang="en-US" id="tit">Converting Text to Numbers</title>
@@ -35,8 +35,8 @@
 <paragraph xml-lang="en-US" id="hd_id0908200901265171" role="heading" level="1"><variable id="numbers_text"><link href="text/scalc/guide/numbers_text.xhp" name="Converting Text to Numbers">Converting Text to Numbers</link>
 </variable></paragraph>
       <section id="text">
-         <paragraph xml-lang="en-US" id="par_id0908200901265127" role="paragraph">Calc converts text inside cells to the respective numeric values if an unambiguous conversion is possible. If no conversion is possible, Calc returns a #VALUE! error.</paragraph>
-         <paragraph xml-lang="en-US" id="par_id0908200901265196" role="paragraph">Only integer numbers including exponent are converted, and ISO 8601 dates and times in their extended formats with separators. Anything else, like fractional numbers with decimal separators or dates other than ISO 8601, is not converted, as the text string would be locale dependent. Leading and trailing blanks are ignored.</paragraph>
+         <paragraph xml-lang="en-US" id="par_id0908200901265127" role="paragraph">Defaults settings in Calc converts text inside cells to the respective numeric values if an unambiguous conversion is possible. If no conversion is possible, Calc returns a #VALUE! error.</paragraph>
+         <paragraph xml-lang="en-US" id="par_id0908200901265196" role="paragraph"><emph>Only integer numbers including exponent are converted</emph>, and ISO 8601 dates and times in their extended formats with separators. Anything else, like fractional numbers with decimal separators or dates other than ISO 8601, is not converted, as the text string would be locale dependent. Leading and trailing blanks are ignored.</paragraph>
          <paragraph xml-lang="en-US" id="par_id0908200901265220" role="paragraph">The following ISO 8601 formats are converted:</paragraph>
          <list type="unordered">
             <listitem>
@@ -70,17 +70,23 @@
          <paragraph xml-lang="en-US" id="par_id0908200901265491" role="paragraph">The century code CC may not be omitted. Instead of the T date and time separator, exactly one space character may be used.</paragraph>
          <paragraph xml-lang="en-US" id="par_id0908200901265467" role="paragraph">If a date is given, it must be a valid Gregorian calendar date. In this case the optional time must be in the range 00:00 to 23:59:59.99999...</paragraph>
          <paragraph xml-lang="en-US" id="par_id0908200901265420" role="paragraph">If only a time string is given, it may have an hours value of more than 24, while minutes and seconds can have a maximum value of 59.</paragraph>
-         <paragraph xml-lang="en-US" id="par_id0908200901265448" role="paragraph">The conversion is done for single arguments only, as in =A1+A2, or ="1E2"+1. Cell range arguments are not affected, so SUM(A1:A2) differs from A1+A2 if at least one of the two cells contain a convertible string.</paragraph>
+         <note id="par_id761567607207916">The conversion is done for single scalar values only, not within ranges.</note>
+         <paragraph xml-lang="en-US" id="par_id0908200901265448" role="paragraph">The conversion is done for single scalar values, as in =A1+A2, or ="1E2"+1. Cell range arguments are not affected, so SUM(A1:A2) differs from A1+A2 if at least one of the two cells contain a convertible string.</paragraph>
          <paragraph xml-lang="en-US" id="par_id090820090126540" role="paragraph">Strings inside formulas are also converted, such as in ="1999-11-22"+42, which returns the date 42 days after November 22nd, 1999. Calculations involving localized dates as strings inside the formula return an error. For example, the localized date string "11/22/1999" or "22.11.1999" cannot be used for the automatic conversion.</paragraph>
          <paragraph xml-lang="en-US" id="hd_id1005200903485368" role="heading" level="2">Example</paragraph>
-         <paragraph xml-lang="en-US" id="par_id1005200903485359" role="paragraph">In A1 enter the text <item type="literal">'1e2</item> (which is converted to the number 100 internally).</paragraph>
-         <paragraph xml-lang="en-US" id="par_id1005200903485341" role="paragraph">In A2 enter <item type="literal">=A1+1</item> (which correctly results in 101).</paragraph>
+         <paragraph xml-lang="en-US" id="par_id1005200903485359" role="paragraph">In A1 enter the text <literal>'1e2</literal> (which is converted to the number 100 internally).</paragraph>
+         <paragraph xml-lang="en-US" id="par_id1005200903485341" role="paragraph">In A2 enter <literal>=A1+1</literal> (which correctly results in 101).</paragraph>
+         <paragraph role="paragraph" id="par_id891567607263849">The formula <literal>=SUM(A1:A2)</literal>, returns 101 instead of 201 because the conversion does not occur in a range, only for single scalar values. Here, '1e2 is treated as string which has value 0 for the SUM function.</paragraph>
+         <paragraph role="paragraph" id="par_id611567607779380"><literal>=SUM("1E2";1)</literal> returns #VALUE! because SUM() and some others that iterate over number sequences explicitly check the argument type.</paragraph>
       </section>
+     <h2 id="hd_id871567772424915">Changing the default text to number conversion settings</h2>
+      <paragraph role="paragraph" id="par_id111567772433803">The text to number conversion can be customized in the <embedvar href="text/shared/optionen/detailedcalculation.xhp#detailed_heading" markup="ignore"/> option.</paragraph>
       <section id="relatedtopics">
+        <embed href="text/shared/optionen/detailedcalculation.xhp#detailed_heading"/>
          <embed href="text/scalc/guide/text_numbers.xhp#text_numbers"/>
          <embed href="text/scalc/guide/integer_leading_zero.xhp#integer_leading_zero"/>
          <paragraph xml-lang="en-US" id="par_id0908200901265544" role="paragraph"><link href="text/shared/01/05020300.xhp" name="Format - Cells - Numbers">Format - Cells - Numbers</link></paragraph>
          <embed href="text/scalc/guide/format_value.xhp#format_value"/>
       </section>
    </body>
-</helpdocument>
\ No newline at end of file
+</helpdocument>
diff --git a/source/text/shared/optionen/detailedcalculation.xhp b/source/text/shared/optionen/detailedcalculation.xhp
index c8bdbc08f..cef7a5058 100644
--- a/source/text/shared/optionen/detailedcalculation.xhp
+++ b/source/text/shared/optionen/detailedcalculation.xhp
@@ -34,7 +34,7 @@
     <section id="detailed_calculation">
         <bookmark xml-lang="en-US" branch="hid/modules/scalc/ui/formulacalculationoptions/FormulaCalculationOptions" id="bm_id2745673" localize="false"/>
         <bookmark xml-lang="en-US" branch="hid/modules/scalc/ui/formulacalculationoptions/@@nowidget@@" id="@@nowidget@@" localize="false"/>
-        <paragraph id="hd_id371535153017185" role="heading" level="1" xml-lang="en-US"><link href="text/shared/optionen/detailedcalculation.xhp" name="detailedcalc">Detailed Calculation Settings</link></paragraph>
+        <paragraph id="hd_id371535153017185" role="heading" level="1" xml-lang="en-US"><variable id="detailed_heading"><link href="text/shared/optionen/detailedcalculation.xhp" name="detailedcalc">Detailed Calculation Settings</link></variable></paragraph>
         <paragraph id="par_id461535153017196" role="paragraph" xml-lang="en-US"><variable id="variable name"><ahelp hid=".">Sets the rules for conversion from strings values to numeric values, string values to cell references, and strings values to date and time values. This affects built-in functions such as INDIRECT that takes a reference as a string value or date and time functions that takes arguments as string values in local or ISO 8601 formats.</ahelp></variable></paragraph>
     </section>
     <section id="howtoget">
@@ -51,10 +51,23 @@
     <paragraph role="paragraph" id="par_id9094515" xml-lang="en-US">This option determines how an empty string is treated when used in arithmetic operations. If you have set "Conversion from text to number" to either "Generate #VALUE! error" or "Treat as zero", you cannot choose (here) if conversion of an empty string to a number will generate an error or if it will treat empty strings as zero. Otherwise this option determines how empty strings are treated.</paragraph>
     <paragraph role="heading" id="par_id3859675" xml-lang="en-US" level="3">Reference syntax for string reference</paragraph>
     <paragraph role="paragraph" id="par_id402233" xml-lang="en-US">Formula syntax to use when parsing references given in string parameters. This affects built-in functions such as INDIRECT that takes a reference as a string value.</paragraph>
-    <paragraph role="paragraph" id="par_id1623889" xml-lang="en-US"><emph>Use formula syntax:</emph></paragraph>
-    <paragraph role="paragraph" id="par_id7781914" xml-lang="en-US"><emph>Calc A1:</emph></paragraph>
-    <paragraph role="paragraph" id="par_id300912" xml-lang="en-US"><emph>Excel A1:</emph></paragraph>
-    <paragraph role="paragraph" id="par_id9534592" xml-lang="en-US"><emph>Excel R1C1:</emph></paragraph>
+          <list type="unordered">
+        <listitem>
+            <paragraph role="listitem" id="par_id1623889" xml-lang="en-US"><emph>Use formula syntax</emph></paragraph>
+        </listitem>
+        <listitem>
+            <paragraph role="listitem" id="par_id7781914" xml-lang="en-US"><emph>Calc A1</emph></paragraph>
+        </listitem>
+        <listitem>
+            <paragraph role="listitem" id="par_id300912" xml-lang="en-US"><emph>Excel A1</emph></paragraph>
+        </listitem>
+        <listitem>
+            <paragraph role="listitem" id="par_id9534592" xml-lang="en-US"><emph>Excel R1C1</emph></paragraph>
+        </listitem>
+        <listitem>
+            <paragraph id="par_id811567770857290"  role="listitem"><emph>Calc A1 | Excel A1</emph></paragraph>
+        </listitem>
+    </list>
     <section id="relatedtopics">
         <paragraph role="paragraph" id="par_id191535211862982" xml-lang="en-US"><link href="text/scalc/01/04060102.xhp" name="dateandtime">Date and time functions</link></paragraph>
         <paragraph role="paragraph" id="par_id261535211868627" xml-lang="en-US"><link href="text/scalc/01/04060109.xhp#Section6" name="indirect">INDIRECT function</link></paragraph>


More information about the Libreoffice-commits mailing list