Calculation based on condition of another field
I am developing a budget layout. I need to take sum of 3 values based on some condition
Here I created some fields, these are as follow:
Credit Card amount
I also have 2 field defining the type of transaction
Field : DebitCardTransaction Type >> contains Value List : ( CashAdvance , Purchase)
Field : CreditCardTransaction Type >> contains Value list : ( CashAdvance , Purchase)
I am trying to make a sum calculation that based on condition:
Total = CashAmount + CreditCard + Debit Card
the problem I face is that
I want to include All cashmounts, All Credit Card amounts ( BOTH CreditCard Transaction Type: Cashadvance AND Purchase ) BUT Debitcard amount(for DebitCard Transaction Type: Include Purchase EXCLUDE CASHADVANCE)
I am kind of new to calculation functions. I could not figure out which functions I could use (get?, Evaluate?, IF? , Case?)
I hope that I could explain what I want to achieve in a clear way so that somebody can recommend me a calculation formula.
Using the fields as defined, you could do it this way:
CashAmount + CreditCard + Debit Card + If ( DebitCardTransaction Type = "Purchase" ; DebitAmount )
This will include debit card amounts only if the type is purchase.