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 

Answers

  • 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

    https://in.linkedin.com/in/anand-shekhawat-35645486

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

  • Nicely answered @anand.shekhawat !

  • Thank You @andrewtye

     

    Unfeigned Regards,

    ~Anand

    https://in.linkedin.com/in/anand-shekhawat-35645486