I want to find the nearest value

Hi,

I want to find the nearest value from numbers.

Ex:- Input Matches with Output
123.23 89 91.12 102.46 102.46

   127           121.89  130       132            121.89

Is any syntax is there, which will solve my problem?

2 Likes

@Jayesh_678 Can you tell me What is the input and what is the Output you expect?

1 Like

can you brief about the solution you are searching for?
cheers
@Jayesh_678

1 Like

Hi @Jayesh_678

Can you add more details for your inquiries to easily address.

cheers :smiley:

Happy learning :smiley:

2 Likes

Hi,
Suppose: Input- 127

I want to match input with 121.89, 130, and 132.

So i want the closest value as output. In this case i want output- 121.89

@Jayesh_678 That is not the Closest value, 132 would be the Closest value to 127 :sweat_smile: , 121 will be the value which is lesser than 127, But what if there was 122 as well?

2 Likes

Refer below post - it help you -

Hi @Jayesh_678,

findNearestValue.xaml (5.5 KB)

I tried your usecase, please have a look.

Thanks!

2 Likes

Hi,
It is not giving me closest value.

Yes, Do you have any solution for it.

@Jayesh_678 To find a Solution, Can you answer this :
What is the nearest value to 127 if these are the inputs :
121.89, 122, 130, and 132

Then we can form a Solution :sweat_smile:

2 Likes

Hi,
I want a to find the closest value.

In this case 130 is the expected output.

@Jayesh_678 ok, How are those numbers Stored, Array?

1 Like

It is stored in excel. I will create an array. There are only three numbers. And one Input numbers. I want to find closest number from that three numbers wrt Input.

Source: Excel file
Destination: Where we have to store the output value?
Can you Share the Source Excel file?

  • I will try from my side.
1 Like

Please find the attached copy.Book1.xlsx (9.5 KB)

@Jayesh_678 Check this :
FindClosestValue.xaml (6.0 KB)

2 Likes

Perfectly working.
you are great. Thanks for help…

1 Like

Hi,
If there is no value in one of the element in array. Then it is not working.