Page 1 of 1

[Solved] Performing calculation based on Checkbox condition

Posted: Mon Aug 22, 2016 5:53 pm
by BigDon
I want to perform a calculation based on the condition (checked or not checked) of a checkbox.

The calculation I want to perform is this: If checkbox A1 is checked, take the value on sheet 2 cell G17 and multiply it by 4. Otherwise return 0. I have tried this

Code: Select all

=IF(A1=TRUE;(Inventory.G17*4);0)
This only returns the TRUE or FALSE state of the checkbox. I have also tried to test for the value in another cell assigning that cell the value of the condition of the checkbox (TRUE/FALSE or 0/1). I get the value of that cell returned to my function performing calculation cell.

My brain tells me this is easy --- my fingers aren't typing out the correct function!!!

Is this possible without a LOT of programming macros? I have several lines that I want to perform similar calculations on based on different cell values on another page.

Thanks for your help!

Re: Performing a calculation based on Checkbox condition

Posted: Mon Aug 22, 2016 6:16 pm
by FJCC
A version of your formula works for me. See the attached file. Simply using IF(A1;Inventory.G17*4;0) should also work.

Re: Performing a calculation based on Checkbox condition

Posted: Mon Aug 22, 2016 6:18 pm
by floris v
Toggle Design mode to ON. Right click the check box, select Control, click the Data tab (in the middle of the dialog box).
Set Linked Cell to A1; set Reference value for On and Off (at the bottom), they're always strings, so enter A and B, for example.
Modify your formula to

Code: Select all

=IF(A1="A";(Inventory.G17*4);0)

Re: Performing a calculation based on Checkbox condition

Posted: Mon Aug 22, 2016 6:40 pm
by BigDon
Thanks for all your replys!!! About the time I had began receiving your responses my fingers decided to cooperate :lol: ... and my brain began working too!! I had turned one of the cells I was working on into a "boolean" cell and THAT was throwing the "TRUE/FALSE" value that was confusing. So after fixing that little issue, I plugged back in my original formula and IT WORKED!!

Thanks for all of you taking your time to respond to this. I feel REALLY stupid now!! :oops: :oops: :oops: