# Help with building calculation/expression in xlsform

Hi ODK pros,
I have been learning XLSform. It's great but I've yet to grasp the xpath
language. May I ask for a push-start on building an expressions?
Basically, I am using two variables, a & b, to calculate a third one, c.
The choices for variables a and b are 0,1 and 99.
If (a=1 and b=1) or (a=0 and b =0) I would like c to spit out 1. For all
else, I would like c to be 0.
would be most grateful.
Respect,
Bill

Have you seen this: http://opendatakit.org/help/form-design/binding/

··· On Mon, May 13, 2013 at 7:13 AM, Bill Olander wrote:

Hi ODK pros,
I have been learning XLSform. It's great but I've yet to grasp the
xpath language. May I ask for a push-start on building an expressions?
Basically, I am using two variables, a & b, to calculate a third one, c.
The choices for variables a and b are 0,1 and 99.
If (a=1 and b=1) or (a=0 and b =0) I would like c to spit out 1. For
all else, I would like c to be 0.
would be most grateful.
Respect,
Bill

## --

You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Bill, you need something like this:

type name calculate calculate c if ((\${a} = 0 and \${b} = 0)
or (\${a} = 1 and \${b} = 1), 1, 0)
I suggest you check out the link that Mitch posted. Lots of information you
could pick up from there.

Nik

··· On Monday, May 13, 2013, Mitch Sundt wrote:

Have you seen this: http://opendatakit.org/help/form-design/binding/

On Mon, May 13, 2013 at 7:13 AM, Bill Olander <billyolander@gmail.com<javascript:_e({}, 'cvml', 'billyolander@gmail.com');> wrote:

Hi ODK pros,
I have been learning XLSform. It's great but I've yet to grasp the
xpath language. May I ask for a push-start on building an expressions?
Basically, I am using two variables, a & b, to calculate a third one,
c. The choices for variables a and b are 0,1 and 99.
If (a=1 and b=1) or (a=0 and b =0) I would like c to spit out 1. For
all else, I would like c to be 0.
would be most grateful.
Respect,
Bill

## --

You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com <javascript:_e({}, 'cvml',
'mitchellsundt@gmail.com');>

## --

You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an