Function for selecting the cell

Aspharagus

New Member
Joined
Aug 18, 2024
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am looking for a excel function which can select the cells in which the value I am looking for falls within.
for example, On column A I have values in degrees and column B has values which excel function has to find it for me.
Sometimes the degrees I am looking for falls between the degrees I have in column A, for that I need to do the linear interpolation and to do that, I need the column B value from the previous and after values.
I am looking for function which does that.
 

Attachments

  • example.JPG
    example.JPG
    61.7 KB · Views: 3

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hello, this should return exact match if there is one, if there is not it should return closest from below and above:

Excel Formula:
=XLOOKUP(K2,A3:A14,B3:B14,XLOOKUP(K2,A3:A14,B3:B14,,{-1,1}))
 
Upvote 0
Thanks Mate, this works!. Also please could you provide any way to find the value if the degree lies between 330 to 0 since it is forming the circle.
 
Upvote 0
Hello, I was wondering... my bad of course... Something like this then:

Excel Formula:
=IF(AND(K2>330,K2<=360),CHOOSEROWS(B3:B14,1,-1),XLOOKUP(K2,A3:A14,B3:B14,XLOOKUP(K2,A3:A14,B3:B14,,{-1,1})))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top