Approximate lookup

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

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 (3.7 KB)

1 Like

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

1 Like

Thanks.