You are viewing limited content. For full access, please sign in.

Question

Question

=SUMIF does not work outside of Collection

asked on March 27, 2018 Show version history

I have a form with a radio button field (let's call it A) that has a value of 1 and then there is another radio button field with choices for Yes/No and then there is a third radio button field (let's call it B) with values of 1,2 and finally a total box with a formula to sum the radio button values. However I only want to sum the value of B if the Yes/No radio button is "Yes". Below is my formula, but it doesn't sum B at all. This same formula works if the radio buttons are inside of a Collection for some reason. 

I wanted to take them out of the Collection to put them inside of a Section instead, but fixing one thing breaks the other. What do you think?

 

SumIf.PNG
SumIf.PNG (17.5 KB)
0 0

Answer

SELECTED ANSWER
replied on March 27, 2018

I don't believe SUMIF is meant for this type of situation. Instead, you should try using a standard IF to add B if the condition is met or 0 if it is not.

For example,

=ADD(SUM(A),IF(radioYes="Yes",SUM(B),0))

Wrapping the A/B variables in SUM will have them default to 0, otherwise you will get a calculation error when nothing is selected.

If radioYes is set to "Yes" it adds B, otherwise it adds 0. I tested this formula and got no errors once I wrapped both A and B in SUM().

1 0

Replies

replied on March 27, 2018 Show version history

Jason,

This works perfectly for what I'm trying to accomplish. I'll test the same scenario outside of the collection from the conversation in this post: https://answers.laserfiche.com/questions/138674/Make-fields-not-required-if-collapsed-section#138718

Thank you,

Raul Gonzalez

0 0
replied on March 27, 2018

Worked really great in conjunction with the other tweak. Time to try it on the real form. Thank Jason.

Thank you,

Raul Gonzalez

Worked.PNG
Worked.PNG (23.86 KB)
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.