3

I created a calculated column named"total value". And I have some other columns named "Value1", "Value2", "Value3". And I created another Choice condition column named"Type".

I want to archive that if "Type" equals "Sum.", "Total value" returns SUM("Value1", "Value2",Value3").

If "Type" equals "Avg.", "Total value" returns AVERAGE("Value1","Value2","Value3").

So I add following forum for "Total value"

=IF(OR([Type]="Sum.",[Type]="Avg."),"SUM([Value1],[Value2],[Value3])","AVERAGE([Value1],[Value2],[Value3])") 

But it failed, it's just display the forum what I define above.

Who can help me to check this? And how to archive my target with other ideas?

2 Answers 2

0

I would remove the OR statement in your formula and have a nested IF instead.

I'm not sure how you created a Type column, when I try that it tells me Type is a reserved word, so for my test I used a field called CalcType.

Here is the formula that works for me. (I'm assuming each of the value fields are numeric, and also the result of the calculated field is numeric)

=IF([CalcType]="Sum.",SUM([Value1],[Value2],[Value3]), IF([CalcType]="Avg.",AVERAGE([Value1],[Value2],[Value3]), 0)) 
0

Try:

=IF([Type]="Sum.",SUM([Value1],[Value2],[Value3]),AVERAGE([Value1],[Value2],[Value3])) 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.