diff --git a/docs/src/features/error-types.md b/docs/src/features/error-types.md index 7f361a4..294481e 100644 --- a/docs/src/features/error-types.md +++ b/docs/src/features/error-types.md @@ -11,11 +11,11 @@ lang: en-US ::: The result of a formula is sometimes an _error_. In some situations those errors are expected and your formulas might be dealing with them. -The error `#N/A` might signal that there is no data to evaluate the formula yet. Maybe the payrol has not been introduced for that month just yet. +The error `#N/A` might signal that there is no data to evaluate the formula yet. Maybe the payroll has not been introduced for that month just yet. Some other errors like `#SPILL!`, `#CIRC!` or `#ERROR!` signal an error in your spreadsheet logic and must be corrected. -The first kind of errors or 'common errors' are found in other spreadsheet engines like Excel while other errrors like `#ERROR!` or `#N/IMPL` are particular to IronCalc. +The first kind of errors or 'common errors' are found in other spreadsheet engines like Excel while other errors like `#ERROR!` or `#N/IMPL` are particular to IronCalc. ## Common Errors @@ -24,7 +24,7 @@ The first kind of errors or 'common errors' are found in other spreadsheet engin It might be caused by mismatched data types (e.g., text used where numbers are expected): ``` -5+"two" +=5+"two" ``` The engine doesn't know how to add the number `5` to the string `two` resulting in a `#VALUE!`. @@ -33,13 +33,13 @@ It is an actual error in your spreadsheet. It indicates that the formula isn’t ### **`#DIV/0!`** -Division by zero or an empty cell. +Division by zero or an empty cell: ``` =1/0 ``` -Usually this is an error. However, in cases where a denominator might be blank (e.g., data not yet filled in), this could be expected. Use `IFERROR` or `IF` to handle it. +Usually this is an error. However, in cases where a denominator might be blank (e.g., data not yet filled in), this could be expected. Use `IFERROR` or `IF` to handle it: ``` =IF(B1=0, "N/A", A1/B1) @@ -47,10 +47,10 @@ Usually this is an error. However, in cases where a denominator might be blank ( ### **`#NAME?`** -Found when a name is not recognized. Maybe a misspeled name for a function. Could be a referenceto defined name that has been deleted. +Found when a name is not recognized. Maybe a misspelled name for a function or a reference to a previously defined name that has since been deleted: ``` -=UNKOWN_FUNCTION(A1) +=UNKNOWN_FUNCTION(A1) ``` This indicates an error in your spreadsheet logic. @@ -59,7 +59,7 @@ This indicates an error in your spreadsheet logic. Indicates an invalid cell reference, often from deleting cells used in a formula. -They can appear as a result of a computation or in a formula. Examples: +They can appear as a result of a computation or in a formula. Example: ``` =Sheet34!A1 @@ -71,16 +71,16 @@ This is a genuine error. It indicates that part of your formula references a cel ### **`#NUM!`** -Invalid numeric operation (e.g., calculating a square root of a negative number). +Invalid numeric operation (e.g., calculating the square root of a negative number). Adjust the formula to ensure valid numeric operations. -Sometimes a `#NUM!` might be expected signalling the user that some parameter is out of scope. +Sometimes a `#NUM!` error might be expected, signalling to the user that some parameter is out of scope. ### **`#N/A`** A value is not available, often in lookup functions like VLOOKUP. -This is frequnly not an error in your spreadsheetlogic. +This is frequently not an error in your spreadsheet logic. You can produce a prettier answer using the [`IFNA`](/functions/information/isna) formula: @@ -95,16 +95,16 @@ Incorrect range operator in a formula (e.g., missing a colon between cell refere ### **`#SPILL!`** A cell in a formula will overwrite content in other cells. -This cannot happen riht now in IronCalc as formulas don't spill yet. +This cannot happen right now in IronCalc as formulas don't spill yet. ### **`#CIRC!`** -Circular reference. This is an error is your spreadsheet and must be fixed. -Means that during teh course of a computation a circular dependency was found. +Circular reference. This is an error in your spreadsheet and must be fixed. +It means that during the course of a computation, a circular dependency was found. A circular dependency is a dependency of a formula on itself. -For instance in the cell `A1` the formula `=A1*2` is a circular dependency. +For instance, in the cell `A1` the formula `=A1*2` is a circular dependency. Other spreadsheet engines use circular dependencies to do "loop computations", run "sensitivity analysis" or "goal seek". @@ -112,35 +112,29 @@ IronCalc doesn't support any of those at the moment. ## IronCalc specific errors ---- - ### **`#ERROR!`** General formula issue, like syntax errors or invalid references. -In general Excel does not let you enter incorrect formulas but IronCalc will. +In general, Excel does not let you enter incorrect formulas, but IronCalc will. -This will make your workbook imcompatible with Excel +This will make your workbook imcompatible with Excel. -For instace an incomplete formula - -``` -=A1+ -``` +Typical examples might be an incomplete formula, such as `=A1+`, or a function call with too few arguments, such as `=FV(1,2)`. ### **`#N/IMPL!`** A particular feature is not yet implemented in IronCalc -Look if there is a Github ticket or contact us via email, Discord or bluesky +Check if there is a [Github](https://github.com/ironcalc) ticket or contact us via [email](mailto:hello@ironcalc.com) or [Discord](https://discord.com/invite/zZYWfh3RHJ). ## Error propagation -Some errors a created by some formulas. For instance the function `SQRT` can create the error `#NUM!` but can't ceate the error `#DIV/0`. +Some errors are created by some formulas. For instance, the function `SQRT` can create the error `#NUM!`, but can't ceate the error `#DIV/0`. -Once an error is created it is normally _propagated_ by all the formulas. So if cell `C3` evaluates to `#ERROR!` then the formula +Once an error is created it is normally _propagated_ by all the formulas. So if cell `C3` evaluates to `#ERROR!`, then the formula `=SQRT(C3)` will return `#ERROR!`. -Not all functions propagate errors in their arguments. For instancethe function `IF(condition, if_true, if_false)` will only propagate an error in the `if_false` argument if the `condition` is `FALSE`. This is called _lazy evaluation_, the function `IF` is _lazy_, it only evaluates the arguments when needed. The opposite of lazy evaulaution is called _eager evaluation_. +Not all functions propagate errors in their arguments. For instance the function `IF(condition, if_true, if_false)` will only propagate an error in the `if_false` argument if the `condition` is `FALSE`. This is called _lazy evaluation_ - the function `IF` is _lazy_ because it only evaluates the arguments when needed. The opposite of lazy evaulaution is called _eager evaluation_. Some functions also expect an error as an argument like [`ERROR.TYPE`](/functions/information/error.type) and will not propagate the error. @@ -154,4 +148,4 @@ The following functions are convenient when working with errors - [`ISNA(ref)`](/functions/information/isna), `TRUE` if ref is `#N/A`. - [`ERROR.TYPE`](/functions/information/error.type) returns the numeric code for a given error. - [`IFERROR(ref, value)`](/functions/logical/iferror) returns `value` if the content of `ref` is an error. -- [`IFNA(ref, value)`](/functions/logical/ifna) return `value` if `ref` is #N/A errors only. +- [`IFNA(ref, value)`](/functions/logical/ifna) returns `value` only if the content of `ref` is the `#N/A` error. diff --git a/docs/src/features/value-types.md b/docs/src/features/value-types.md index 0bd2efd..1c65d5d 100644 --- a/docs/src/features/value-types.md +++ b/docs/src/features/value-types.md @@ -10,47 +10,49 @@ lang: en-US **Note:** This draft page is under construction 🚧 ::: -In IronCalc a value, a result of a calculation can be one of: +In IronCalc a value, a result of a calculation, can be one of the following. ## Numbers -Numbers in IronCalc are [IEEE 754 double precission](https://en.wikipedia.org/wiki/Double-precision_floating-point_format). +Numbers in IronCalc are [IEEE 754 double-precision](https://en.wikipedia.org/wiki/Double-precision_floating-point_format). -Numbers are only displayed up to 15 significant figures. That's why '=0.1+0.2' is actually '0.3' +Numbers are only displayed up to 15 significant figures. That's why `=0.1+0.2` gives `0.3`. -Also numbers are compared up to 15 significant figures. So `=IF(0.1+0.2=0.3, "Valid", "Invalid")` will return `Valid`. +Also, numbers are compared up to 15 significant figures. So `=IF(0.1+0.2=0.3, "Valid", "Invalid")` gives `Valid`. -However `=0.3-0.2-0.1` will not result in `0` in IronCalc. +However, `=0.3-0.2-0.1` will not give exactly `0` in IronCalc. ### Casting into numbers -Strings and booleans are sometimes coverted to numbers +Strings and booleans are sometimes converted to numbers: -`=1+"2"` => 3 +`=1+"2"` => `3` Some functions cast in weird ways: -SUM(1, TRUE) => 2 -SUM(1, "1") => 2 +`=SUM(1,TRUE)` => `1` and `=SUM(1,"1")` => `1` -But SUM(1, A1) => 1 (where A1 is TRUE or "1") +And `=SUM(1,A1)` => `1` (where A1 contains `TRUE` or `"1"`) -Sometimes the conversion happens like => "123"+1 is actually 124 and the SQRT("4") is 2 or the SQRT(TRUE) is 1. +Sometimes the conversion happens as might be expected. For example, `="123"+1` is `124`, `=SQRT("4")` is `2` and `=SQRT(TRUE)` is `1`. -Some functions, however are more strict BIN2DEC(TRUE) is #VALUE! +Some functions, however, are more strict. For example, `=BIN2DEC(TRUE)` gives the #VALUE! error. -### Dates +### Dates and times -On spreadsheets a date is just the number of days since January 1, 1900. +IronCalc uses numbers to represent dates and times. +The integer part of the number represents the date, as a count of days since the fixed starting date of December 30, 1899. + +The fractional part of the number represents the time of day. 0.0 corresponds to 00:00:00 (midnight) and 0.5 corresponds to 12:00:00 (noon). ## Strings ### Complex numbers -On IronCal a complex number is just a string like "1+j3". +Using IronCalc, a complex number is a string of the form "1+j3". ## Booleans