[Calc] how to compare not exactly equal values?

Hallo everyone.
I do realize my post title is not very descriptive. Sorry for that.
I have 2 (or sometimes more) values (numbers) and want to compare them and check if they are more-less equal. Let say the condition is fulfilled if the numbers are exactly equal or the difference is not higher than (+/-) 1.
Here is the example:

3,1 3 TRUE
5,9 6 TRUE
7 -5 FALSE
10 9 TRUE
-6 -6 TRUE

Any clues how I can do this?
Regards,
gordom

For two numbers,
=ABS(A1-B1)<=1

For more than two numbers,
=MAX(A1;B1;C1;...)-MIN(A1;B1;C1;...)<=1

I trust this helps.

Brian Barker

W dniu 2015-02-04 o 15:24, Brian Barker pisze:

I have 2 (or sometimes more) values (numbers) and want to compare them
and check if they are more-less equal. Let say the condition is
fulfilled if the numbers are exactly equal or the difference is not
higher than (+/-) 1.
Here is the example:

3,1 3 TRUE
5,9 6 TRUE
7 -5 FALSE
10 9 TRUE
-6 -6 TRUE

Any clues how I can do this?

For two numbers,
=ABS(A1-B1)<=1

For more than two numbers,
=MAX(A1;B1;C1;...)-MIN(A1;B1;C1;...)<=1

I trust this helps.

Brian Barker

Thank you very much. That's very helpful.
Regards,
gordom