Jan 11, 2021 03:28 AM
i have the following colums that iam trying to combine in a formula :
I need a formula in a new column which combines the two following conditions:
IF “indirect” is chosen, then copy the same amount
IF “direct” is chosen, then apply a 12% on the “indirect total sales revenue”
i hope it is clear enough.
Thyank you very much in advance!
Solved! Go to Solution.
Jan 11, 2021 09:58 PM
Kuovonne,
You were 100% correct. No need to use the SWITCH instruction (even though I learnt something new!).
My IF formula works exactly as I needed it to.
Thank you again for your help, very instructive.
François
Jan 11, 2021 08:41 AM
Welcome to the Airtable community!
The formula field reference has info on the functions to combine to do what you want.
IF( {customer billing) = "indirect",
{indirect total sales revenue},
{indirect total sales revenue} * 1.12,
)
Jan 11, 2021 09:50 AM
thank you very much! it helps.
the first condition of the formula works.
I still need the second condition in the formula
should the formula continue with:
OR IF ( {customer billing = “direct”, {indirect total sales revenue}) ?
Jan 11, 2021 09:52 AM
thank you very much Kuovonne! it helps.
the first condition of the formula works.
I still need the second condition in the formula
should the formula continue with:
OR IF ( {customer billing = “direct”, {indirect total sales revenue}) ?
Thank you again!
Jan 11, 2021 10:30 AM
The second situation is handled in the last part of the ÌF
function, where the {indirect total sales revenue} is multiplied by 1.12. Since the {customer billing} field can only have two values, the function only needs to test if the {customer billing} is “indirect”. If {customer billing} is not “indirect”, then it must be “direct”, without having to explicitly test for it.
On the other hand, if you really want a different formula that explicitly lists all of the possible values for the {customer billing} field, you can use a switch function.
SWITCH({customer billing},
"indirect", {indirect total sales revenue},
"direct", {indirect total sales revenue} * 1.12
)
There are many different ways of doing things with formulas/code. Pick whatever makes the most sense to you.
If neither of these formulas work for you, please send a screen capture annotated with your desired results!
Jan 11, 2021 09:58 PM
Kuovonne,
You were 100% correct. No need to use the SWITCH instruction (even though I learnt something new!).
My IF formula works exactly as I needed it to.
Thank you again for your help, very instructive.
François