Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

# Checkbox Formatting

Topic Labels: Formulas
212 6
cancel
Showing results for
Did you mean:  4 - Data Explorer

Hi! How do I format total cost with if the checkbox is checked it multiplies the cost by 50% and if the checkbox is unchecked, it keeps the full total amount?

Example: cost= \$100, if I check the checkbox it totals the cost to 100*.50= \$50; if the box is unchecked it totals the cost to \$100

6 Replies 6  16 - Uranus

The following will multiply the cost by .5 if the checkbox is checked and 1 (no change) if the checkbox is unchecked.

``````{Cost} * IF({Checkbox}, .5, 1)
``````  4 - Data Explorer

Thank you so much! Is there a way to add if another check fox is checked it subtracts the entire expense calculating to 0. Ex: Checkbox A (like you just explained) but then for the total cost if Checkbox B is checked then it subtracts the full amount and if it is not checked it keeps the full amount? This is used our expense reporting and for our partnership co-op dollars if it is a co-branded, our partner covers half the cost, if it is fully branded by them they cover the whole expense and if its not co-op at all we cover the entire expense  16 - Uranus

I don’t quite get your wording, so here’s a guess.

“If Checkbox B is filled, subtract the result of the first formula from {Cost}. If Checkbox B is empty, show the cost”.

``````IF(
{Checkbox B},
{Cost} - ({Cost} * IF({Checkbox A}, .5, 1)),
{Cost}
)
``````  4 - Data Explorer

Sorry, I will send a screenshot to help explain the total cost needs to be 0 if full co-op is checked and the total cost needs to be multiplied by 50% if it is checked. If neither are checked it needs to stay the full amount. I tried to use the second formula you send and it is giving me an error.  16 - Uranus

The formula was missing a comma, it has been corrected. But in any event, sounds like the formula you want is closer to:

``````IF(
{Full Co-Op},
0,
{Cost} * IF({Half Co-Op}, .5, 1)
)
``````  4 - Data Explorer

This worked. Thank you so much:) 