# Approximate lookup

**URL:** <https://community.easymorph.com/t/approximate-lookup/5176>\
**Category:** Feature requests\
**Created:** [February 22, 2024, 9:33am UTC](https://community.easymorph.com/t/approximate-lookup/5176 "2024-02-22T09:33:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![reynsnivea](https://community.easymorph.com/letter_avatar_proxy/v4/letter/r/9f8e36/32.png) [@reynsnivea](https://community.easymorph.com/u/reynsnivea)\
**Post date:** [February 22, 2024, 9:33am UTC](https://community.easymorph.com/t/approximate-lookup/5176/1 "2024-02-22T09:33:34Z")

</div>

Hi,

Is it possible to add a lookup mode to have an approximate match like in Excel VLOOKUP?

For example: I want to search a year in another table. If the year is not in the lookup table, I want to return the year that is closest to the year we want to look up.

Thanks  
Nikolaas

---

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [February 22, 2024, 8:05pm UTC](https://community.easymorph.com/t/approximate-lookup/5176/2 "2024-02-22T20:05:31Z")

</div>

It should be possible to do with the "Interval merge" action. See a simplified example below. It's not universal but conveys the principle: construct a lookup table, then use "Interval merge".

[closest-lookup.morph](https://community.easymorph.com/uploads/short-url/4PgNjsVKvENfccdwOG2LOWve5Lm.morph) (3.7 KB)

 ![image](https://community.easymorph.com/uploads/default/original/2X/4/449806c95d0b1ad58d5d08d0b2d7cf04f549d57d.png)

---

<div class="post-metadata">

**Author:** ![cvo](https://community.easymorph.com/letter_avatar_proxy/v4/letter/c/a88e57/32.png) [@cvo](https://community.easymorph.com/u/cvo)\
**Post date:** [February 23, 2024, 3:42pm UTC](https://community.easymorph.com/t/approximate-lookup/5176/3 "2024-02-23T15:42:23Z")

</div>

Hi,

You can also operate a cartesian product between the 2 tables.  
Then make the difference between the 2 year columns, convert in absolute value and keep the min difference.

Regards

---

<div class="post-metadata">

**Author:** ![reynsnivea](https://community.easymorph.com/letter_avatar_proxy/v4/letter/r/9f8e36/32.png) [@reynsnivea](https://community.easymorph.com/u/reynsnivea)\
**Post date:** [February 26, 2024, 8:17am UTC](https://community.easymorph.com/t/approximate-lookup/5176/4 "2024-02-26T08:17:11Z")

</div>

Thanks.
