Dear all, hello !
How to find matches that are equal to or closest to and less than the current value?
Please look at the data. I want to search for the current row of [Old_Value] in the field column [New_Value]. If I can find an equal value, I will return the value of the corresponding row [New_Name] where the equal value is located. If I cannot find an equal value, I will match the value of the corresponding row [New_Came] where the value closest to and less than [Old_Value] is located, just like using the Approximate match option of the Excel function xlookup.
For example, I am searching for 30 in [New_Value], but [New_Value] does not have a row equal to 30. The item closest to 30 and less than is 29, so we return the value 'P' of [New_Name] corresponding to the row where 29 is located.
| Input | | | Output | | |
| Old_Name | Old_Value | | Old_Name | Old_Value | Get |
| a | 30 | | a | 30 | P |
| b | 25 | | b | 25 | M |
| c | 10 | | c | 10 | N |
| d | 2 | | d | 2 | C |
| | | | | | |
| | | | | | |
| Match | | | | | |
| New_Name | New_Value | | | | |
| U | 32 | | | | |
| P | 29 | | | | |
| M | 24 | | | | |
| N | 8 | | | | |
| C | 2 | | | | |