Excel tip with LC equivalent: Value comparison

FlexibleLearning admin at FlexibleLearning.com
Sun Nov 27 07:06:52 EST 2011


I have an Excel speadsheet that is kinda self-checking in that 3 cells
display the same value if I have made no data entry errors.

How to determine if cells A1, B1 and C1 are the same value...

Put this in cell D1 to display 'TRUE' or 'FALSE':

=IF(A1=B1,IF(B1=C1,TRUE,FALSE),FALSE)

Bonus feature
How to colorize cell D1 with green for 'TRUE' and red for 'FALSE' for visual
feedback.

Use the 'Format' menu to select 'Conditional Formatting...' and apply these
2 rules:

Cell Value + is equal to + TRUE
Use the 'Format...' button to select 'Font' with a green color, and
'Patterns' with the same green for cell shading (effectively 'hides' the
text).

Click 'Add>>', and then

Cell Value + is equal to + FALSE
Use the 'Format...' button to select 'Font' with a red color, and 'Patterns'
with the same red for cell shading (effectively 'hides' the text).

Finally click OK.


LiveCode equivalent:

if (fld "A1"=fld "B1") AND (fld "B1"=fld "C1") then
  set the backcolor of fld "D1" to "green"
else set the backColor of fld "D1" to "red"
set the opaque of fld "D1" to true


Little triumphs, big joy  :)

Hugh Senior
FLCo





More information about the use-livecode mailing list