I’m sorry if this question has already been asked but I can’t find it and can’t use the examples I have found to work in my situation.
I have a form that is a log of items I’ve purchased. So far I keep a running total that is displayed in the list view by having my form calculation summary be that of the “subtotal” field.
I’d like to add a Checkmark field (or something) labeled “returned” so that if I returned the item the total would not contain that items price in my total summary.
So far I have a number field labeled “price” and a calculation field labeled “subtotal”. The formula is ([Price]*.081)+[Price])
I get the item price plus tax.
I want to add the field “returned” and get the result I am looking for.
Please help. And sorry if it’s obvious but I can’t get it to work. Thanks!
Yvette
Hi Yvette,
The Checkmark field will be stored in the database as a 0 or a 1. So multiply your formula by your Checkmark field, then when the Checkmark field is OFF, the result will be 0 because anything multiplied by 0 is 0. When it’s ON, the result will be whatever the main part of your formula results in because a value multiplied by 1 results in that value.
Hope that makes sense.
Thanks,
Brendan
I was working a similar formula for the weight of items added to, or not added to my backpack using the “if” statement. Had I thought about Brendan’s solution, that would have been the elegant solution. I used the inelegant “if” statement.
I was thinking that if you care about credits or something other than zero when “return” is checked, the “if” statement could be used, as in the following example:
if([returned],([price]*-0.081+[Price]*-1),([price]*0.081+[Price]))
If returned is checked/true: the formula gives a negative result equivalent to the price plus tax (a credit)
If returned is unchecked/false: the formula gives the price plus tax