Jump to content

Find The Total Closest To Specific Number


CoffeeAddict

Recommended Posts

I have a project I'm working on and I'm stuck on how to order results closest to a specific number.

 

I have a breed of dog with an ideal number. We will say 250

 

For that breed I have 5 different dogs all that have their own set of numbers. I then added those together and now have a single total for each of those 5 dogs.

 

Out of those 5 numbers, I need to order them by the closest to 250.

 

Now some may be below 250 or above 250.

 

Lets say my totals for these 5 dogs were

 

240

310

122

109

87

 

 

That right there is how I would want them ordered. Because 240 is closest to 250 and so on.

 

I know how to order by ascending or desceding, but not how to order according to a specific number. Help please?

Edited by CoffeeAddict
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.