How can I return 1, instead True from IF statement

I tried many combinations but I didn’t manage it.
Here some combinations

Can I do this?

TRUE is 1. You don’t even need IF for that: simple =F3=F12 already does what you want - will give 1 when these are equal. The only thing that confuses you is cell format: just change it from Logical (set automatically when Calc detects that you return a logical value from the formula) to Number, to see the wanted result.

Thanks, but I need to sum these ones.

great - it works, e.g.


Calc does not discern between logical and number data types, so you can use a boolean TRUE as a number 1. The Standard format specifier will display as TRUE/FALSE if the calculation context is boolean, but the underlying data is numeric 1/0.

One issue I see with your sample formulas as posted: you specify to return the digit "1" and not the number 1. Calc SUM() function will disregard textual content, only summing the cells which contain a number (or a formula returning a number). Explicit calculation with operators means that you insist “this is a number”, so Calc will give its best attempt to interpret it as such.

Note that between LO Calc and Microsoft Excel there are significant differences when working with this kind of “implicit typing”. On one hand it enforces stronger typing, so a boolean cannot always be assumed equivalent to a number. On the other hand, the Excel SUM() function does not distinguish strongly between text and numeric types, so the result with operators and with the SUM() function is more likely to be equal. If you rely on implicit conversions and require compatibility with different spreadsheet softwares, you are treading down a perilous path.

If this does not help you to solve your issue, edit your quetion to attach your file (or make a sample with similar content) so we can see what you are working with. That helps us to provide a solution specific to the issue(s) you have. Remember this is a public place. Do not post or upload confidential material.