IF statement help

CommunityMember113484
Occasional Contributor

IF statement help

Hi,

I need some help with my formula - separately they are fine, but it doesn't quite work when I combine them together.  In the consol I had initially just combined the formulas in A, B & C but it did not work so I then changed the formula slightly (see below).  What should the consol formula be?

Thanks

 

AIF Line item A = X THEN 'Item A % of Total' * 'Total Amount' ELSE 0
BIF Line item B = X THEN 'Item B % of Total' * 'Total Amount' ELSE 0
CIF Line item C = X THEN 'Item C % of Total' * 'Total Amount' ELSE 0
A + B + C [THIS WORKS]A' + 'B' + 'C'
Consol.IF Line item A = X THEN 'Item A % of Total' * 'Total Amount' + IF Line item B = X THEN 'Item B % of Total' * 'Total Amount'  + IF Line item C = X THEN 'Item C % of Total' * 'Total Amount' ELSE 0 ELSE 0 ELSE 0 
4 REPLIES 4
anand.shekhawat
Frequent Contributor

Re: IF statement help

Hi @CommunityMember113484,

The three 'Else 0' that you have written in the consol. formula is incorrect. You need to use those 'Else 0' individually with every if statement just before the addition.

The formula somewhat would look like this IF Line item A = X THEN 'Item A % of Total' * 'Total Amount' ELSE 0 + IF Line item B = X THEN 'Item B % of Total' * 'Total Amount' ELSE 0 + IF Line item C = X THEN 'Item C % of Total' * 'Total Amount' ELSE 0 . Just like A+B+C.

 

Kindly correct the syntax, and the formula will run smoothly.

 

I hope this helps. 

 

~Anand

CommunityMember113484
Occasional Contributor

Re: IF statement help

I did that earlier but it didn't work so I changed the syntax, but now looks like it does work?! Thanks

andrewtye
Master Anaplanner/Community Boss

Re: IF statement help

Nicely answered @anand.shekhawat !

anand.shekhawat
Frequent Contributor

Re: IF statement help

Thank You @andrewtye , a kudo coming from you means a lot.

 

Unfeigned Regards,

~Anand