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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.