Excel selective search for a combination of values - urgent

S

Shashank

Hi All !

I have a problem to solve using some sort of a simple method in excel.

I have 2 columns
Mark Country(can be A or B)
10 A
20 B
30 A
40 B
50 A
60 A
70 A
80 A
90 B
150 B
so here the average of marks = 55
and A:B = 3:2

Now I need to select say 5 Marks from above table which has the 3A's and
2B's and has an average of 55.

Even something using MS Query could be of good help.

I tried this query ( it gives me repetitive values but the correct result
set.)
But my table will have say 1000 rows and I need to select something like 100
values and i'll die even if I think of creating a query like this.

SELECT table1.Spd AS 'a1', table1.Region as 'r1', table2.Spd AS 'a2',
table2.Region as 'r2',
table3.Spd AS 'a3', table3.Region as 'r3'
FROM `C:\test\tesmporart`.table2 table1,
`C:\test\tesmporart`.table2 table2,
`C:\test\tesmporart`.table2 table3
WHERE ((table1.Spd+table2.Spd+table3.Spd)/3=60) AND (table1.Region='A') AND
(table2.Region='A') AND (table3.Region='A') and (table1.Spd <> table2.Spd)
and
(table1.Spd <> table3.Spd) and (table2.Spd <> table3.Spd)


Any simple efficient way would be of great help.
(I know I can write an algo using macros and stuff.. ..but I don't want to
do that ...any short , simple , sweet way would be great. .. :))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top