[Solved] Checkbox and IF function problem

Discuss the spreadsheet application

[Solved] Checkbox and IF function problem

Postby kmnbc13 » Wed Jan 16, 2019 4:16 am

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
kmnbc13
 
Posts: 3
Joined: Wed Jan 16, 2019 4:05 am

Re: Checkbox and IF function problem

Postby FJCC » Wed Jan 16, 2019 4:42 am

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)
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7190
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Checkbox and IF function problem

Postby kmnbc13 » Wed Jan 16, 2019 4:47 am

Thank you very much
OpenOffice 4.1.5 on Windows 10
kmnbc13
 
Posts: 3
Joined: Wed Jan 16, 2019 4:05 am


Return to Calc

Who is online

Users browsing this forum: Google [Bot] and 19 guests