Actually, your first formula concatenates all the IF() results by the & operator. Concatenation is a text operation, so the result in cell E7 is not the number 2, but rather the character "2".

With "strict type handling", text does not have a numerical value, and attempts to calculate from "text as numbers" will invariably return errors.

Calc (and other spreadsheets) have rather loose type handling, which appears "friendlier" but sometimes gives unexpected ("wrong") results.

Loose type handling goes like this: For spreadsheet formulas finding a text where a number is expected, the software first attempts an unambiguous numerical interpretation (newer versions of Calc, Excel). If numeric interpretation is ambiguous or impossible, either return numeric zero (older versions of Calc like in your case), or an error (as it should return, IMHO).

There are two sensible ways to deal with this. Either one should solve the issue at hand, but I suggest you do both:

- Upgrade to a current version of Calc. (v.3.1 is rather old, and has a few flaws)
- Alter your E7 formula so it returns a number instead of text.

Formula suggestions (either one should do):

- Code: Select all Expand viewCollapse view
`=IF(D7="CW";0;IF(D7="OOK";1; IF(D7="FSK";2;IF(D7="GFSK";3;""))))`

=MATCH(D7;{"CW";"OOK";"FSK";"GFSK"};0)-1

The first is a "nested if", which evaluates the next condition only if the previous returned "false".

The second uses list matching, which returns the sequence number of a matching entry in the list.