Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I posted a query a short while ago and had an informed answer within a couple of hours. Terrific!..."

Geography

Where in the world do Tek-Tips members come from?

Choosing & Adding Six Numbers from Eight in Excel

Tarquine (Vendor)
3 Mar 00 14:22
A pal of mine would like to have a list of runners in the left-hand column and in each of the next eight columns would be the event placings for eight different races. From these eight positions he would like to select only the first six placings and total them

We decided that he would need to use SUMIF. However we cannot figure out how to setup the criteria for such a calculation. Does anyone know how this can be done? The names of each runner must be down the left-hand side.

Any help would be nice

Regards

Tarquine
DougP (MIS)
3 Mar 00 15:58
=SUMIF(B1:B8,"<6")
so you would get a total at the bottom of each column then total or whatever all of the columns
Maybe????

DougP
dposton@universal1.com

Tarquine (Vendor)
4 Mar 00 7:04
Ah! I think I didn't explain this correctly. Each competitor will receive some points between 0 and 200. The competitor's names must be down the left-hand side, see below for example:

Names Loc1 Loc2 Loc3 Loc4 Loc5 Loc6 Loc7 Loc8 Total

Fred 60 52 150 25 25 132 78 65
Harry 75 200 175 30 0 67 190 185
Tom 169 93 115 95 165 100 150 111
Etc (imagine that the numbers line up under each heading)

The loc will donate the venues. What we are trying to do is take the top 6 races, from a possible 8 races, for each competitor, total them and place the result to the right-hand side of the row. Of course we cannot sort them on this page as it cause the results to get messed up.

I hope this makes it a lot clearer and you can provide me with an answer.

Regards

Tarquine
dsawford (Programmer)
4 Mar 00 14:22
You will need a area of your spreadsheet set up for intermediate calculations. You could use any place on this sheet, or even another sheet. I think you could then write a macro that would sort each line individually in the intermediate area and leave the original data unsorted; however the following method should give you the results you want without a macro.

For this example, I am inserting 11 columns between Loc8 and Total (J through T).
After the formulas are all entered, you can then hide these columns. You could also put these columns elsewhere as mentioned above, and adjust the formulas accordingly.

J: =MINA(B2:I2) *** find first minimum value
K: =COUNTIF(B2:I2,J2) *** count occurrences of this minimum value
L: =IF(B2=$J2,300,B2) *** get Loc1 value unless it is the min. value, in which case make it a large value (i.e. 300)
M through S: *** copy column L into these columns.
T: =MINA(L2:S2) *** find minimum value of new table.
U (Total column): =SUM(B2:I2)-(IF(K2>=2,J2*2,J2+T2)) *** This takes the sum from the original row, subracts from it either: (first min. * 2) if 2 or more occurrences, or if only 1 occurrence, subtracts (first min + 2nd min).
This will give the total of the top 6 values for this row. You can then copy J through
U down as far as you need to cover all runners.
Tarquine (Vendor)
5 Mar 00 3:23
Many many thanks for your suggestion. I have made up a spreadsheet using your instructions and the results appear to be exactly what we were looking for.

Once again thanks for taking the time out to answer my questions.

Regards

Tarquine
Tarquine (Vendor)
5 Mar 00 18:53
Ah! I think I might have been a bit premature with my praise. When I said that I had placed it into a spreadsheet I should have said that it was in Excel 2000. And yes it works a treat. However, if the same is attempted in Excel 97 then it will not accept MINA(L2:S2) as a valid value. At least that is what Excel 2000 says when I try to save it that format.

I have tried to carry out the same instructions using Excel 97 and there appears to be a problem in that all the values in columns M through S return the row one value all the way down that column.

Is this correctable or should I get my pal to spend a bit more money and purchase the latest edition:-)

Regards

Tarquine
dsawford (Programmer)
6 Mar 00 6:58
Tarquine:
I used Excel97 myself to set up and test this, so it should work.
The first thing to check if it is always bringing in the first row values when you copy it down is where the $ sign is in the formula.
=IF(B2=$J2,300,B2) is the correct formula: the $ before J column tells it to always refer to J column even when copied elsewhere. Make sure that a $ did not also get in front of the 2 which would always refer to the second row instead of the same row relative to it's current position. The other columns on row 2 should also read $J2 in the formula after copying, but the 2 should automatically change to the current row as you copy it down if there is no $ in front of the #.
I have not used Excel 2000, so have no idea why 'Save As' might give problems.
Check this and let me know,
dsawford
Tarquine (Vendor)
9 Mar 00 15:25
Ok! You win:-) I had followed your instructions to the letter and for some reason the computer with Excel 97 on it was not refreshing correctly. After I had sorted that bit out all was well.

Again many thanks for the answer my query.

Regards

Tarquine

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close