[Solved] Checkbox and IF function problem

Discuss the spreadsheet application
Post Reply
kmnbc13
Posts: 3
Joined: Wed Jan 16, 2019 4:05 am

[Solved] Checkbox and IF function problem

Post 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
Last edited by robleyd on Wed Jan 16, 2019 10:38 am, edited 2 times in total.
Reason: Add green tick
OpenOffice 4.1.5 on Windows 10
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Checkbox and IF function problem

Post by FJCC »

Try

Code: Select all

=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

=IF(C2 <> 0; B2;0)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
kmnbc13
Posts: 3
Joined: Wed Jan 16, 2019 4:05 am

Re: Checkbox and IF function problem

Post by kmnbc13 »

Thank you very much
OpenOffice 4.1.5 on Windows 10
Post Reply