hi,
I want to build a VBA query that selects the results I want and write the results in a different sheet. Below I added the data and the expected results(I don't know how to do it elseway). Basically what I want to set is the following:
The data is in column A to E. For the query
column D <0.5
column E<2
column B = top 5 performers given D<0.5 and E<2
column C = top 3 given D<0.5, E<2, B=top 5
The result of the query should be the letter in column A and has to be saved in the next sheet.
Column A Column B Column C Column D Column E
AA 5 8 0.56 1.65
BB -6 12 1.5 1.90
CC 8 14 0.2 1.10
DD 9 -40 0.7 1.00
EE 47 56 0.9 1.90
FF 98 89 0.3 2.83
GG 216 47 2 2.91
HH 56 -24 2.5 2.79
II 479 -5 0.99 2.46
JJ 1 7 0.1 1.97
KK 20 45 0.25 1.64
LL 23 7 0.67 1.56
MM 56 32 2.1 1.51
NN 78 91 0.4 1.81
OO 98 -56 0.9 1.31
PP -6 -71 1.8 1.96
QQ -89 61 2.1 1.24
RR 12 -3 0.97 1.87
SS 79 86 0.53 1.43
TT 35 14 0.48 1.57
UU 49 19 1.6 1.92
VV 76 21 0.2 1.41
WW 89 25 0.56 2.53
XX 9 -8 0.78 2.41
YY -45 46 0.98 1.42
ZZ -15 73 1.43 1.81
Results of query:
NN, SS, EE
these 3 should then be saved in sheet 2 as a result.
I know the first 2 conditions are simple if ... then ... statements, but then I get in trouble with the top 5 and top 3 of the top 5 and saving the result ...
thanks in advance for ur input ...
[/img]
I want to build a VBA query that selects the results I want and write the results in a different sheet. Below I added the data and the expected results(I don't know how to do it elseway). Basically what I want to set is the following:
The data is in column A to E. For the query
column D <0.5
column E<2
column B = top 5 performers given D<0.5 and E<2
column C = top 3 given D<0.5, E<2, B=top 5
The result of the query should be the letter in column A and has to be saved in the next sheet.
Column A Column B Column C Column D Column E
AA 5 8 0.56 1.65
BB -6 12 1.5 1.90
CC 8 14 0.2 1.10
DD 9 -40 0.7 1.00
EE 47 56 0.9 1.90
FF 98 89 0.3 2.83
GG 216 47 2 2.91
HH 56 -24 2.5 2.79
II 479 -5 0.99 2.46
JJ 1 7 0.1 1.97
KK 20 45 0.25 1.64
LL 23 7 0.67 1.56
MM 56 32 2.1 1.51
NN 78 91 0.4 1.81
OO 98 -56 0.9 1.31
PP -6 -71 1.8 1.96
QQ -89 61 2.1 1.24
RR 12 -3 0.97 1.87
SS 79 86 0.53 1.43
TT 35 14 0.48 1.57
UU 49 19 1.6 1.92
VV 76 21 0.2 1.41
WW 89 25 0.56 2.53
XX 9 -8 0.78 2.41
YY -45 46 0.98 1.42
ZZ -15 73 1.43 1.81
Results of query:
NN, SS, EE
these 3 should then be saved in sheet 2 as a result.
I know the first 2 conditions are simple if ... then ... statements, but then I get in trouble with the top 5 and top 3 of the top 5 and saving the result ...
thanks in advance for ur input ...
[/img]