# Approach to a value

**URL:** <https://community.wolfram.com/t/approach-to-a-value/2011>\
**Category:** Questions\
**Tags:** statistics-and-probability\
**Created:** [April 18, 2014, 11:09pm UTC](https://community.wolfram.com/t/approach-to-a-value/2011 "2014-04-18T23:09:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![22padrinos](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/22padrinos/32/29645_2.png) [@22padrinos](https://community.wolfram.com/u/22padrinos)\
**Post date:** [April 18, 2014, 11:09pm UTC](https://community.wolfram.com/t/approach-to-a-value/2011/1 "2014-04-18T23:09:12Z")

</div>

Hi everybody, I have the follow problem, for example give the list {{100,220},{123,154},{210,202},{129,86}} find in this list the value more proximate to {186,190}, I don not know how do it, someone know?,this is giving me a lot of trouble, thanks in advance

---

<div class="post-metadata">

**Author:** ![halemichaeljr](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/halemichaeljr/32/22773_2.png) [@halemichaeljr](https://community.wolfram.com/u/halemichaeljr)\
**Post date:** [April 18, 2014, 11:45pm UTC](https://community.wolfram.com/t/approach-to-a-value/2011/2 "2014-04-18T23:45:36Z")

</div>

```auto
Nearest[{{100, 220}, {123, 154}, {210, 202}, {129, 86}}, {186, 190}]

```

---

<div class="post-metadata">

**Author:** ![22padrinos](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/22padrinos/32/29645_2.png) [@22padrinos](https://community.wolfram.com/u/22padrinos)\
**Post date:** [April 19, 2014, 4:23am UTC](https://community.wolfram.com/t/approach-to-a-value/2011/3 "2014-04-19T04:23:41Z")

</div>

many thanks Michael, the command do it ,but I have problems with the following, if run the command Nearest[{{290,230},{250,170},{180,140}},{280,105}] returns {290,230} but I want the value {250,170},ie I want to always return the closest value but less than the first number I enter as an argument of the function, in this case {280,105} the first number is 280 and I want the closest value but less ie the 250, Is there any way?

With another example I hope to explain,  
Nearest[{{425,218},{383,178},{529,431},{690,571}},{412,280}] returns {425,218} and I want the closest but less {383,178}, I hope you can help me

---

<div class="post-metadata">

**Author:** ![halemichaeljr](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/halemichaeljr/32/22773_2.png) [@halemichaeljr](https://community.wolfram.com/u/halemichaeljr)\
**Post date:** [April 19, 2014, 4:59am UTC](https://community.wolfram.com/t/approach-to-a-value/2011/4 "2014-04-19T04:59:54Z")

</div>

Do you mean you want to find the nearest after deleting all of the points that are to the right of the input point?

```auto
nearestLess[p_] :=
Nearest[Select[{{425, 218}, {383, 178}, {529, 431}, {690,
     571}}, #[[1]] < p[[1]] &], p]

```

```auto
nearestLess@{412, 280}

```

```auto
{{383, 178}}

```

---

<div class="post-metadata">

**Author:** ![22padrinos](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/22padrinos/32/29645_2.png) [@22padrinos](https://community.wolfram.com/u/22padrinos)\
**Post date:** [April 20, 2014, 12:33am UTC](https://community.wolfram.com/t/approach-to-a-value/2011/5 "2014-04-20T00:33:34Z")

</div>

is amazing, as I needed I thank you for helping me with this problem and hopefully keep it up with more people, we are in contact
