Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to determine the closest degree?

Does anyone have any suggestions on how to determine the closest degree?
Given condition 360 degree = 0 degree
There is a list of degrees in row 1.
303(Q1), 10(R1), 310(S1), 310(T1), 170(U1), 351(V1), 324(W1)
There is a given degree in cell O1
I would like to determine the closest degree, which is greater than and less
than the given degree.

Example one, if the given degree is 1, then it should return 10 in cell N1,
because it is closest degree and greater than 1, and it should return 351 in
cell M1, because it is closest degree and less than 1.

Example two, if the given degree is 340, then it should return 351 in cell
N1, because it is closest degree and greater than 340, and it should return
324 in cell M1, because it is closest degree and less than 340.

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default How to determine the closest degree?

well, the formula is somehow complicate, but it should match your requirement.
M1=IF(SMALL(Q1:W1,1)=O1,MAX(Q1:W1),LARGE(Q1:W1,RA NK(O1,O1:W1,0)+(COUNT(O1:W1)+1-RANK(O1,O1:W1,0)-RANK(O1,O1:W1,1))))
N1=IF(LARGE(Q1:W1,1)<=O1,MIN(Q1:W1),SMALL(Q1:W1,RA NK(O1,O1:W1,1)+(COUNT(O1:W1)+1-RANK(O1,O1:W1,0)-RANK(O1,O1:W1,1))))

"Eric" wrote:

Does anyone have any suggestions on how to determine the closest degree?
Given condition 360 degree = 0 degree
There is a list of degrees in row 1.
303(Q1), 10(R1), 310(S1), 310(T1), 170(U1), 351(V1), 324(W1)
There is a given degree in cell O1
I would like to determine the closest degree, which is greater than and less
than the given degree.

Example one, if the given degree is 1, then it should return 10 in cell N1,
because it is closest degree and greater than 1, and it should return 351 in
cell M1, because it is closest degree and less than 1.

Example two, if the given degree is 340, then it should return 351 in cell
N1, because it is closest degree and greater than 340, and it should return
324 in cell M1, because it is closest degree and less than 340.

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 272
Default How to determine the closest degree?

M1:=SMALL(Q1:V1,MOD(COUNTIF(Q1:V1,"<"&O1)-1,COUNT(Q1:V1))+1)
N1:=SMALL(Q1:V1,MOD(COUNTIF(Q1:V1,"<"&O1),COUNT(Q1 :V1))+1)

"Eric" wrote:

Does anyone have any suggestions on how to determine the closest degree?
Given condition 360 degree = 0 degree
There is a list of degrees in row 1.
303(Q1), 10(R1), 310(S1), 310(T1), 170(U1), 351(V1), 324(W1)
There is a given degree in cell O1
I would like to determine the closest degree, which is greater than and less
than the given degree.

Example one, if the given degree is 1, then it should return 10 in cell N1,
because it is closest degree and greater than 1, and it should return 351 in
cell M1, because it is closest degree and less than 1.

Example two, if the given degree is 340, then it should return 351 in cell
N1, because it is closest degree and greater than 340, and it should return
324 in cell M1, because it is closest degree and less than 340.

Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine the closest value? Eric Excel Discussion (Misc queries) 7 November 11th 08 01:24 AM
How to determine the closest value? Eric Excel Discussion (Misc queries) 2 November 5th 08 03:05 PM
Imputting an angle degree. Degree, minute, second Graham Excel Discussion (Misc queries) 6 October 19th 06 03:07 PM
Imputting an angle degree. Degree, minute, second Graham Excel Worksheet Functions 1 October 13th 06 07:58 PM
Convert decimal degree (lattitude/longitude) into Degree, Tim Ashcom Excel Discussion (Misc queries) 5 August 17th 05 04:53 PM


All times are GMT +1. The time now is 02:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"