Page 1 of 1

[Solved] Checkbox and IF function problem

PostPosted: Wed Jan 16, 2019 4:16 am
by kmnbc13
Hello everyone,
I am trying to set a simple IF function Like this : "=IF(C2="TRUE",(B2),0) where "TRUE" comes from a cell with a checkbox connected to the same cell and B2 is a price in € and i get either error 508 or #NAME?
If anybody could help i would appreciate it.It is very simple so i think the problem might be that the checkbox has as LinkedCell the same cell as the checkbox itself.

Thanks in advance

Re: Checkbox and IF function problem

PostPosted: Wed Jan 16, 2019 4:42 am
by FJCC
Try
Code: Select all   Expand viewCollapse view
=IF(C2;B2;0)

Things to note:
1. Use a semicolon between the parts of a function.
2. Using C2 = "TRUE" as the first part of the IF() does not work because the TRUE or FALSE value sent by the checkbox is a number, not the text "TRUE" or "FALSE". The cell format is set to display the number 1 as TRUE and the number 0 as FALSE. You can see this by changing the cell format of C2 with the menu Format -> Cells. If you set the format to display integers, clicking the checkbox will toggle the cell between 0 and 1.
3. In OpenOffice, FALSE is Zero and TRUE is Not Zero. So my formula is equivalent to
Code: Select all   Expand viewCollapse view
=IF(C2 <> 0; B2;0)

Re: Checkbox and IF function problem

PostPosted: Wed Jan 16, 2019 4:47 am
by kmnbc13
Thank you very much