# How to change an answer to an equation based on tickbox

I'm new to coding even more so on excel or google sheet. I'm currently trying to make a simple Combination and Permutation calculator based on a true or false statement in a tickbox, if true then it will calculate the combination of n and r. If false then it will calculate the permutation of n and r.

Here's a little demonstration of what I'm trying to achieve:

So, I would like to make an "if statement" that checks the true or false statement in C5, then if it's true, simply do "=COMBIN(B3, D3)" and if it's false, then do "=PERMUT(B3, D3)". Then print the result to C10.

• Welcome to Web Applications. Please checkout the help article for the IF function -> support.google.com/docs/answer/3093364?hl=en. If you need further help, please show what you tried and add a brief description of your search efforts as is suggested in How to Ask. Commented Aug 10, 2021 at 12:19
• thankyou Rubén, that's actually very helpful. Commented Aug 10, 2021 at 13:02

The checkbox in cell C5 will be true when the box is ticked, and false when unticked, so you can just use this simple formula in cell C10:
=if( C5, combin(B3, D3), permut(B3, D3) )