Spreadsheet: 162143d1339745102-if-function-comparing-data-in-range-example
Sheet: Sheet1

OUTSMS_after | OUTSMS_before | My variant
145 | 157
44 | 18 |  | This is right, cause value in a3 is bigger than value in b3, also bigger than b3 +3
48 | 10
42 | 22
92 | 33
5 | 0
21 | 53 |  | This is right, cause value in a8 is smaller than value in b8, also smaller than b8 -3
13 | 9
1 | 1
97 | 81
6 | 0
45 | 25
2 | 4
12 | 10 |  | There should be "Same", cause b15 comparing to a15 is only +2
11 | 57
0 | 3 |  | There should be "Same", cause b17 comparing to a17 is only -3
4 | 2 |  | There should be "Same", cause b18 comparing to a18 is only +2
32 | 17
20 | 8
0 | 1
17 | 5
15 | 21
20 | 17
5 | 9
7 | 2
8 | 15
90 | 93
1 | 1
2 | 0
27 | 51
673 | 259
5 | 2
14 | 13
5 | 24
13 | 10
5 | 8
1 | 0
3 | 2
2 | 0
525 | 154
306 | 48
12 | 31
11 | 45
2 | 4
0 | 1
35 | 39
1 | 3
37 | 139
100 | 132
1 | 6
53 | 17
40 | 30
1 | 1
3 | 3
3 | 1
20 | 30
89 | 34
62 | 46
233 | 267
8 | 3
89 | 335
80 | 47
1 | 3
5 | 1
2 | 0
38 | 79
387 | 338
1 | 0
0 | 1
2 | 9
27 | 139
1 | 0
162 | 87
18 | 37
57 | 91
2 | 1
18 | 9
10 | 12
4 | 2
4 | 1
285 | 18
43 | 6
1 | 0
28 | 11
12 | 4
17 | 10
24 | 43
11 | 7
1 | 4
914 | 161
4 | 0
18 | 17
1 | 2
0 | 242
1 | 1
1 | 1
0 | 5
3 | 6
29 | 6
49 | 76
605 | 426
2 | 0
2 | 2
33 | 14
13 | 3
11 | 1
68 | 87
7 | 7
21 | 39
8 | 8
8 | 14
8 | 12
56 | 15
8 | 24
8 | 12
70 | 29
4 | 5
39 | 35
32 | 2
38 | 11
12 | 2
46 | 39
584 | 0
6 | 1
16 | 9
20 | 11
7 | 0
60 | 36
4 | 4
10 | 4
15 | 23
0 | 3
108 | 56
1 | 2
126 | 232
37 | 2
1 | 1
173 | 266
341 | 108
21 | 22
410 | 583
1 | 0
909 | 625
16 | 5
33 | 12
1 | 0
3 | 5
21 | 6
3 | 3
2 | 0
158 | 17
42 | 37
167 | 346
23 | 44
13 | 11
141 | 70
5 | 4
5 | 12
7 | 9
1 | 2
0 | 2
9 | 292
2 | 1
24 | 9
6 | 21
2 | 4
617 | 799
51 | 5
1 | 3
1 | 1
7 | 6
48 | 38
62 | 114
7 | 4
1 | 2
25 | 10
2 | 1
1 | 1
275 | 106
127 | 63
14 | 11
6 | 6
0 | 9
60 | 137
14 | 20
30 | 14
7 | 9
4 | 13
104 | 169
30 | 22
7 | 24
7 | 6
36 | 82
106 | 65
1 | 2
49 | 0
64 | 49
47 | 98
2 | 2
4 | 7
49 | 89
16 | 16
169 | 244
10 | 2
108 | 48
13 | 1
99 | 17
7 | 1
35 | 16
36 | 38
43 | 59
43 | 37
0 | 7
25 | 1
35 | 23
356 | 3
11 | 19
3 | 6
1 | 2
32 | 40
8 | 1
21 | 25
18 | 7
29 | 2
2 | 0
8 | 12
9 | 1
1 | 5
2 | 1
14 | 7
23 | 3
67 | 394
53 | 36
4 | 5
6 | 8
3 | 6
2 | 1
38 | 4
1 | 0
1 | 4
8 | 26
23 | 3
12 | 9
1 | 0
0 | 4
177 | 46
1 | 3
29 | 14
7 | 3
194 | 4
2 | 2
2 | 0
22 | 6
12 | 0
2 | 0
47 | 389
105 | 67
2 | 4
198 | 60
150 | 16
266 | 124
101 | 43
3 | 1
2 | 61
28 | 18
6 | 10
10 | 40
3 | 123
6 | 2
10 | 6
7 | 8
56 | 75
163 | 12
0 | 7
12 | 15
1 | 1
32 | 9
0 | 3
23 | 4
21 | 5
0 | 4
417 | 568
74 | 34
21 | 11
2 | 3
0 | 2
205 | 324
138 | 436
16 | 20
7 | 38
1 | 0
4 | 5
7 | 10
39 | 1
61 | 72
1 | 5
1478 | 3
17 | 12
1 | 0
17 | 19
409 | 4
4 | 4
1 | 14
2 | 1
1 | 2
180 | 76
15 | 27
37 | 54
1 | 0
1392 | 118
5 | 2
2 | 2
13 | 15
139 | 30
15 | 4
7 | 4
31 | 14
1 | 1
1 | 0
29 | 82
65 | 17
680 | 184
200 | 86
18 | 8
1 | 4
29 | 34
1 | 0
117 | 66
11 | 8
1 | 0
1 | 0
3 | 10
3 | 5
11 | 20
11 | 74
5 | 6
17 | 74
21 | 24
87 | 38
41 | 41
11 | 3
269 | 162
3 | 5
2 | 3
116 | 394
2 | 5
1 | 2
14 | 8
6 | 23
6 | 15
12 | 8
9 | 0
11 | 26
2 | 1
13 | 26
2 | 1
1 | 1
131 | 1039
19 | 2
0 | 1
14 | 7
212 | 15
65 | 144
16 | 26
11 | 9
1 | 0
253 | 22
47 | 16
18 | 1
92 | 73
2 | 7
1 | 0
73 | 56
45 | 24
32 | 3
5 | 0
311 | 356
0 | 1
2 | 1
3 | 18
13 | 15
285 | 0
8 | 7
5 | 10
4 | 8
1 | 0
380 | 321
2 | 3
741 | 124
0 | 9
133 | 61
14 | 20
22 | 18
225 | 255
0 | 7
3 | 4
3 | 1
3 | 0
17 | 2
9 | 13
7 | 13
8 | 1
10 | 128
16 | 25
8 | 4
4 | 2
379 | 65
3 | 3
28 | 126
27 | 53
6 | 17
106 | 87
291 | 266
22 | 36
25 | 25
8 | 9
70 | 23
13 | 6
0 | 3
1095 | 16
10 | 1
2 | 1
0 | 1
7 | 1
287 | 31
28 | 93
3 | 6
23 | 34
159 | 163
19 | 16
0 | 1
3 | 0
6 | 2
6 | 2
118 | 39
2 | 2
1492 | 1224
70 | 32
261 | 212
1 | 5
2 | 0
38 | 18
13 | 18
10 | 2
46 | 90
12 | 1
1 | 0
168 | 58
4 | 4
49 | 134
18 | 8
6 | 0
49 | 7
661 | 333
9 | 5
4 | 0
81 | 189
88 | 182
21 | 6
4 | 0
57 | 32
13 | 1
2 | 16
6 | 1
5 | 0
73 | 29
32 | 39
1 | 8
1 | 1
1 | 2
39 | 7
165 | 5
25 | 19
416 | 62
2 | 7
21 | 2
9 | 1
20 | 25
3 | 0
12 | 21
90 | 45
1 | 0
104 | 86
3 | 0
0 | 6
1 | 0
16 | 5
15 | 3
1 | 2
17 | 4
1 | 1
1 | 0
26 | 7
59 | 25
17 | 1
62 | 14
28 | 2
1 | 38
71 | 126
9 | 9
56 | 35
18 | 12
1 | 0
1 | 10
51 | 77
6 | 4
10 | 3
1 | 1
2 | 0
422 | 96
0 | 1
0 | 3
16 | 7
25 | 16
32 | 11
78 | 93
13 | 24
6 | 3
3 | 6
7 | 1
3 | 0
120 | 17
0 | 6
5 | 0
1 | 0
14 | 26
1 | 0
8 | 0
2 | 2
38 | 17
6 | 1
1 | 3
25 | 6
0 | 3
262 | 246
3 | 1
6 | 4
2 | 2
4 | 4
38 | 32
1 | 1
4 | 4
52 | 637
2 | 1
6 | 23
1163 | 382
0 | 1
123 | 11
14 | 1
4 | 6
1 | 3
2 | 1
5 | 1
5 | 7
3 | 12
238 | 735
7 | 3
389 | 263
18 | 12
1 | 1
6 | 4
21 | 3
4 | 17
7 | 4
101 | 99
18 | 151
3 | 2
19 | 0
3 | 4
107 | 92
76 | 31
40 | 233
88 | 35
3 | 0
7 | 8
2 | 2
10 | 8
8 | 2
31 | 67
48 | 13
193 | 24
47 | 15
1 | 0
32 | 12
2 | 1
92 | 281
0 | 1
13 | 2
12 | 28
23 | 11
1 | 0
59 | 26
3 | 10
2 | 1
0 | 16
6 | 0
8 | 4
1 | 4
43 | 3
12 | 5
36 | 6
5 | 0
340 | 312
2 | 8
1 | 1
28 | 1
0 | 9
8 | 5
5 | 52
87 | 165
2 | 4
2 | 0
53 | 38
7 | 13
49 | 32
52 | 46
155 | 25
59 | 14
2 | 2
296 | 129
25 | 18
453 | 24
1 | 1
51 | 64
31 | 5
588 | 415
2895 | 336
127 | 114
2 | 2
59 | 23
11 | 5
24 | 5
8 | 6
24 | 9
6 | 13
3 | 2
2 | 1
5 | 3
18 | 15
1 | 0
27 | 30
28 | 13
15 | 28
28 | 12
11 | 2
77 | 13
9 | 0
2 | 1
5 | 1
1 | 5
4 | 8
306 | 87
4 | 0
4 | 0
21 | 1
3 | 1
3 | 3
30 | 9
23 | 15
1 | 3
203 | 39
391 | 1060
5 | 5
23 | 10
96 | 12
2 | 2
2 | 13
447 | 259
71 | 49
7 | 3
15 | 9
0 | 1
8 | 1
274 | 366
1 | 10
11 | 67
9 | 3
54 | 38
59 | 41
783 | 905
41 | 29
4031 | 3306
9 | 5
6 | 4
300 | 349
229 | 159
21 | 75
2 | 5
50 | 22
59 | 20
3 | 0
7 | 13
3 | 4
17 | 6
7 | 2
0 | 4
8 | 0
19 | 5
70 | 177
1 | 5
73 | 123
23 | 24
109 | 72
26 | 9
6 | 0
47 | 42
3 | 7
7 | 8
9 | 22
2 | 11
4 | 1
7 | 3
21 | 14
12 | 40
19 | 7
16 | 2
21 | 7
68 | 83
15 | 13
0 | 46
1 | 9
31 | 22
3 | 6
4 | 9
63 | 69
2 | 2
3 | 3
32 | 14
19 | 36
28 | 84
14 | 11
35 | 46
16 | 9
1761 | 2129
8 | 9
178 | 120
21 | 19
19 | 128
23 | 74
4 | 2
4 | 6
7 | 3
12 | 3
173 | 158
54 | 7
1032 | 4
34 | 18
26 | 20
279 | 321
0 | 2
4 | 4
1 | 2