Using Excel 2010
Hello, I got lottery results in column D:H approximately 2000+ rows, and set of quads in column K:N approximately 65000+ rows, I need a VBA which can loop quads… through column D:H and generate the find DELAY result in column O as shown in the few lines example below.
Regards,
Moti
Hello, I got lottery results in column D:H approximately 2000+ rows, and set of quads in column K:N approximately 65000+ rows, I need a VBA which can loop quads… through column D:H and generate the find DELAY result in column O as shown in the few lines example below.
Find Dealy MrExcel.xlsm | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | |||
1 | ||||||||||||||||||||
2 | Example Results | |||||||||||||||||||
3 | 30 | Need VBA To Find | ||||||||||||||||||
4 | Last Delay | |||||||||||||||||||
5 | Draw | Date | n1 | n2 | n3 | n4 | n5 | Quads | Loop Delay Within n1:n5 | |||||||||||
6 | 1 | 13/02/2004 | 16 | 29 | 32 | 36 | 41 | 16 | 29 | 32 | 36 | 29 | <--Last Appeared In Draw 1 (Total Draw=30) So Delay = 29 | |||||||
7 | 2 | 20/02/2004 | 7 | 13 | 39 | 47 | 50 | 15 | 24 | 28 | 44 | 14 | <--Last Appeared In Draw 16 (Total Draw=30) So Delay = 14 | |||||||
8 | 3 | 27/02/2004 | 14 | 18 | 19 | 31 | 37 | 8 | 12 | 14 | 15 | 9 | <--Last Appeared In Draw 21 (Total Draw=30) So Delay = 9 | |||||||
9 | 4 | 05/03/2004 | 4 | 7 | 33 | 37 | 39 | 3 | 21 | 30 | 34 | 10 | <--Last Appeared In Draw 20 (Total Draw=30) So Delay = 10 | |||||||
10 | 5 | 12/03/2004 | 15 | 24 | 28 | 44 | 47 | 4 | 12 | 24 | 36 | 22 | <--Last Appeared In Draw 8 (Total Draw=30) So Delay = 22 | |||||||
11 | 6 | 19/03/2004 | 33 | 36 | 37 | 42 | 45 | 14 | 15 | 28 | 35 | ? | ||||||||
12 | 7 | 26/03/2004 | 3 | 4 | 10 | 23 | 43 | 9 | 13 | 34 | 41 | ? | ||||||||
13 | 8 | 02/04/2004 | 4 | 12 | 24 | 27 | 36 | 5 | 15 | 24 | 35 | ? | ||||||||
14 | 9 | 09/04/2004 | 1 | 4 | 10 | 19 | 23 | 1 | 11 | 22 | 28 | ? | ||||||||
15 | 10 | 16/04/2004 | 14 | 15 | 28 | 35 | 40 | 16 | 29 | 32 | 41 | ? | ||||||||
16 | 11 | 23/04/2004 | 6 | 10 | 21 | 45 | 49 | 15 | 16 | 21 | 36 | ? | ||||||||
17 | 12 | 30/04/2004 | 5 | 6 | 16 | 23 | 27 | 20 | 27 | 41 | 43 | ? | ||||||||
18 | 13 | 07/05/2004 | 15 | 16 | 21 | 36 | 38 | 8 | 12 | 15 | 34 | 0 | <--Last Appeared In Draw 30 (Total Draw=30) So Delay = 0 | |||||||
19 | 14 | 14/05/2004 | 1 | 3 | 21 | 32 | 39 | |||||||||||||
20 | 15 | 21/05/2004 | 15 | 29 | 37 | 39 | 49 | |||||||||||||
21 | 16 | 28/05/2004 | 15 | 24 | 28 | 32 | 44 | |||||||||||||
22 | 17 | 04/06/2004 | 9 | 13 | 34 | 41 | 42 | |||||||||||||
23 | 18 | 11/06/2004 | 2 | 7 | 8 | 10 | 47 | |||||||||||||
24 | 19 | 18/06/2004 | 2 | 23 | 28 | 40 | 43 | |||||||||||||
25 | 20 | 25/06/2004 | 3 | 21 | 30 | 34 | 35 | |||||||||||||
26 | 21 | 02/07/2004 | 8 | 12 | 14 | 15 | 37 | |||||||||||||
27 | 22 | 09/07/2004 | 2 | 5 | 12 | 19 | 44 | |||||||||||||
28 | 23 | 16/07/2004 | 24 | 26 | 31 | 38 | 50 | |||||||||||||
29 | 24 | 23/07/2004 | 7 | 10 | 27 | 31 | 34 | |||||||||||||
30 | 25 | 30/07/2004 | 9 | 10 | 19 | 37 | 50 | |||||||||||||
31 | 26 | 06/08/2004 | 5 | 15 | 24 | 35 | 44 | |||||||||||||
32 | 27 | 13/08/2004 | 20 | 27 | 41 | 43 | 50 | |||||||||||||
33 | 28 | 20/08/2004 | 6 | 9 | 10 | 27 | 35 | |||||||||||||
34 | 29 | 27/08/2004 | 1 | 11 | 22 | 28 | 44 | |||||||||||||
35 | 30 | 03/09/2004 | 8 | 12 | 14 | 15 | 34 | |||||||||||||
36 | ||||||||||||||||||||
37 | ||||||||||||||||||||
38 | ||||||||||||||||||||
Find Last Delay |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C3 | C3 | =MAX(IF(C6:C35<>"",ROW(C6:C35)))-5 |
Press CTRL+SHIFT+ENTER to enter array formulas. |
Regards,
Moti