Date: prev next · Thread: first prev next last
2026 Archives by date, by thread · List index


Regina,

The main concept about the TYPE() function is to be an alternative to
multiple conditional results, depending on the result of some formula.

For example, let's say that a formula could return "an expected"
result (say, a numeric value), but under some circumstances it could
possibly return something else. For instance, the source data is not
yet filled-in, so some formula that depends on that data returns an
error; or instead of some numeric value a formula returns "yes" as
Text, or "no" as Text, or "-" instead of zero. I am not saying this
kind of formula is recommended or not; I am just conveying a basic
situation in order to give you an example of the usage of the TYPE()
function.

Now you want to "catch" every possible type of result for such formula
and react accordingly. Instead of having multiple conditionals
combined with ISTEXT(), ISNUMBER(), ISERROR(), ISNOTEXT(),
ISLOGICAL()..., there might be less conditionals required when using
TYPE(). It all depends on how many "cuts" you want to make in the
final result.

You can combine TYPE() with other Information functions (IS*(),
ERRORTYPE(), ERROR.TYPE()...). Again, it depends on how much control
and cuts you want to have for the final result; how many different
reactions you want to provide according to the original data.

You could have a (long) list of possible source data, even data that
is not the expected type (intentionally, or not), and test (using,
among others, the TYPE() function) what a formula returns as a result
of each value (or set of values) in the (long) list. This could also
be potentially useful for reporting bugs about Calc's functions.

Another example would be when you have some problem building a
function, or importing data, with some inconsistent result and you
want to analyze where exactly is the mistake located, what exactly is
triggering the problem. Sometimes you would use menu View > Value
Highlighting. In some circumstances, you might use several Information
functions instead, at least temporarily. And/or, you could use the
TYPE() function and review ("live") in which cases the formula result
(or some range of cells with some kind of data) is a Numeric value, or
it is Text that just looks as a number, or that some branching /
conditional is providing a simple scalar vs an array result... IOW, it
could work as a "Value Highlighting" method, where you can search or
filter the results (instead of having to manually look for different
font colors within some column / range of cells).

Depending on the result of TYPE(), you could apply Conditional Formatting.

These are only generic examples, or course.

HTH,
Ady.

-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.