Comparison Types Available

The Comparison option in the If action tab allows you to compare a variable entered in the Name of variable to compare box with text, a number or another variable entered in the Compare with panel.

Note:
You can compare text as well as numbers – see Comparing Text below for more information.

The comparison types available are:

Type

Description

Equals

This is an exact match e.g. 70 = 70. This is the most commonly used option.

Contains

Allows you to search the answer for something e.g. 70,80,90 – this will return a value of TRUE if you enter 70 or 80 or 90.

Greater than

The number must be larger than the one specified e.g. 70 > 69 would return a TRUE value but 70 > 70 would not because it does not catch numbers of the same value.

Less than

The number must be smaller than the one specified e.g. 60 < 70 would return a TRUE value but 60 < 60 would not.

Greater than or equal to

This will catch numbers that are both larger than or the same as the one specified e.g. 70 > 69 and 70 > 70 will return a TRUE value.

Less than or equal to

This will catch numbers that are both smaller or the same as the one specified e.g. 60 < 60 and 60 < 70 will return a TRUE value.

Comparing Text:

You can use these Comparison types on text as well (and on single letters) – the results will follow the alphabetical order, that is C is Greater than A.

However, when comparing whole words, the calculation will be done on the ASCII value of the letters involved. The ASCII value is a code number given each letter for programming purposes. The main "alphabet" starts at number 65 for A, 66 for B, 67 for C, and so on through the whole alphabet.

Note:
Lowercase letters are later than uppercase letters in the ASCII code, which means they are numbered after the uppercase numbers. Thus a will be Greater than A – it will also be Greater than Z.

Related Topics:

the IF action

ASCII Characters