# Invalid Variable "sum" in formula editor

**URL:** <https://molflow-forum.web.cern.ch/t/invalid-variable-sum-in-formula-editor/213>\
**Category:** General discussion\
**Created:** [June 21, 2019, 6:32pm UTC](https://molflow-forum.web.cern.ch/t/invalid-variable-sum-in-formula-editor/213 "2019-06-21T18:32:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fce761984c1341f66ab5](https://molflow-forum.web.cern.ch/letter_avatar_proxy/v4/letter/f/b5a626/32.png) [@fce761984c1341f66ab5](https://molflow-forum.web.cern.ch/u/fce761984c1341f66ab5)\
**Post date:** [June 21, 2019, 6:32pm UTC](https://molflow-forum.web.cern.ch/t/invalid-variable-sum-in-formula-editor/213/1 "2019-06-21T18:32:18Z")

</div>

Following from https://molflow.web.cern.ch/content/new-variables-formula-editor

I used the folowing formula sum(A,NEG)/D707 where NEG is the name of a memorized selction group. I am getting the error "Invalid variable sum(A,NEG)".

I appear to have idential syntax to that from the documentation, but am getting an error?

&nbsp;

Thanks

---

<div class="post-metadata">

**Author:** ![maarton](https://molflow-forum.web.cern.ch/letter_avatar_proxy/v4/letter/m/e5b9ba/32.png) [@maarton](https://molflow-forum.web.cern.ch/u/maarton)\
**Post date:** [June 21, 2019, 8:07pm UTC](https://molflow-forum.web.cern.ch/t/invalid-variable-sum-in-formula-editor/213/2 "2019-06-21T20:07:27Z")

</div>

Use capital _SUM_ instead of _sum_, and instead of _NEG_, use _Sn_ where _n_ is the number of the selection (_S1_&nbsp;for example).

(The name of the selection cannot be the reference to the selection, as it could be a formula itself, leading to ambigious parsing).
