# Calculation based on condition of another field

Question asked by Lantonicus on Mar 4, 2012
Latest reply on Mar 5, 2012 by philmodjunk

### Title

Calculation based on condition of another field

### Post

Hello All,

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:

Cashamount

DebitAmount

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.

example

Regards