Find a value between two range of angles in degrees

rajaniesh

New Member
Joined
Aug 13, 2013
Messages
48
Hi,


[TABLE="class: grid, width: 518"]
<tbody>[TR]
[TD="width: 94, bgcolor: transparent"]B
[/TD]
[TD="width: 106, bgcolor: transparent"]C
[/TD]
[TD="width: 84, bgcolor: transparent"]D
[/TD]
[TD="width: 100, bgcolor: transparent"]E
[/TD]
[TD="width: 78, bgcolor: transparent"]F
[/TD]
[TD="width: 116, bgcolor: transparent"]G
[/TD]
[TD="width: 110, bgcolor: transparent"]H
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Natal House
[/TD]
[TD="bgcolor: transparent"]Start House(NZ)
[/TD]
[TD="bgcolor: transparent"]Degree Start
[/TD]
[TD="bgcolor: transparent"]End House(NZ)
[/TD]
[TD="bgcolor: transparent"]Degree End
[/TD]
[TD="bgcolor: transparent"]Degree Cum Start
[/TD]
[TD="bgcolor: transparent"]Degree Cum End
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent, align: right"]10
[/TD]
[TD="bgcolor: transparent, align: right"]01°42'56.00
[/TD]
[TD="bgcolor: transparent, align: right"]11
[/TD]
[TD="bgcolor: transparent, align: right"]10°08'45.00
[/TD]
[TD="bgcolor: transparent, align: right"]271°42'56.00
[/TD]
[TD="bgcolor: transparent, align: right"]310°08'45.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]2
[/TD]
[TD="bgcolor: transparent, align: right"]11
[/TD]
[TD="bgcolor: transparent, align: right"]10°08'45.00
[/TD]
[TD="bgcolor: transparent, align: right"]12
[/TD]
[TD="bgcolor: transparent, align: right"]17°28'53.00
[/TD]
[TD="bgcolor: transparent, align: right"]310°08'45.00
[/TD]
[TD="bgcolor: transparent, align: right"]347°28'53.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]3
[/TD]
[TD="bgcolor: transparent, align: right"]12
[/TD]
[TD="bgcolor: transparent, align: right"]17°28'53.00
[/TD]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent, align: right"]18°15'04.00
[/TD]
[TD="bgcolor: transparent, align: right"]347°28'53.00
[/TD]
[TD="bgcolor: transparent, align: right"]18°15'04.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]4
[/TD]
[TD="bgcolor: transparent, align: right"]1
[/TD]
[TD="bgcolor: transparent, align: right"]18°15'04.00
[/TD]
[TD="bgcolor: transparent, align: right"]2
[/TD]
[TD="bgcolor: transparent, align: right"]13°31'10.00
[/TD]
[TD="bgcolor: transparent, align: right"]18°15'04.00
[/TD]
[TD="bgcolor: transparent, align: right"]43°31'10.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]5
[/TD]
[TD="bgcolor: transparent, align: right"]2
[/TD]
[TD="bgcolor: transparent, align: right"]13°31'10.00
[/TD]
[TD="bgcolor: transparent, align: right"]3
[/TD]
[TD="bgcolor: transparent, align: right"]06°41'22.00
[/TD]
[TD="bgcolor: transparent, align: right"]43°31'10.00
[/TD]
[TD="bgcolor: transparent, align: right"]66°41'22.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]6
[/TD]
[TD="bgcolor: transparent, align: right"]3
[/TD]
[TD="bgcolor: transparent, align: right"]06°41'22.00
[/TD]
[TD="bgcolor: transparent, align: right"]4
[/TD]
[TD="bgcolor: transparent, align: right"]01°42'56.00
[/TD]
[TD="bgcolor: transparent, align: right"]66°41'22.00
[/TD]
[TD="bgcolor: transparent, align: right"]91°42'56.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]7
[/TD]
[TD="bgcolor: transparent, align: right"]4
[/TD]
[TD="bgcolor: transparent, align: right"]01°42'56.00
[/TD]
[TD="bgcolor: transparent, align: right"]5
[/TD]
[TD="bgcolor: transparent, align: right"]10°08'45.00
[/TD]
[TD="bgcolor: transparent, align: right"]91°42'56.00
[/TD]
[TD="bgcolor: transparent, align: right"]130°08'45.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]8
[/TD]
[TD="bgcolor: transparent, align: right"]5
[/TD]
[TD="bgcolor: transparent, align: right"]10°08'45.00
[/TD]
[TD="bgcolor: transparent, align: right"]6
[/TD]
[TD="bgcolor: transparent, align: right"]17°28'53.00
[/TD]
[TD="bgcolor: transparent, align: right"]130°08'45.00
[/TD]
[TD="bgcolor: transparent, align: right"]167°28'53.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]9
[/TD]
[TD="bgcolor: transparent, align: right"]6
[/TD]
[TD="bgcolor: transparent, align: right"]17°28'53.00
[/TD]
[TD="bgcolor: transparent, align: right"]7
[/TD]
[TD="bgcolor: transparent, align: right"]18°15'04.00
[/TD]
[TD="bgcolor: transparent, align: right"]167°28'53.00
[/TD]
[TD="bgcolor: transparent, align: right"]198°15'04.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]10
[/TD]
[TD="bgcolor: transparent, align: right"]7
[/TD]
[TD="bgcolor: transparent, align: right"]18°15'04.00
[/TD]
[TD="bgcolor: transparent, align: right"]8
[/TD]
[TD="bgcolor: transparent, align: right"]13°31'10.00
[/TD]
[TD="bgcolor: transparent, align: right"]198°15'04.00
[/TD]
[TD="bgcolor: transparent, align: right"]223°31'10.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]11
[/TD]
[TD="bgcolor: transparent, align: right"]8
[/TD]
[TD="bgcolor: transparent, align: right"]13°31'10.00
[/TD]
[TD="bgcolor: transparent, align: right"]9
[/TD]
[TD="bgcolor: transparent, align: right"]06°41'22.00
[/TD]
[TD="bgcolor: transparent, align: right"]223°31'10.00
[/TD]
[TD="bgcolor: transparent, align: right"]246°41'22.00
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]12
[/TD]
[TD="bgcolor: transparent, align: right"]9
[/TD]
[TD="bgcolor: transparent, align: right"]06°41'22.00
[/TD]
[TD="bgcolor: transparent, align: right"]10
[/TD]
[TD="bgcolor: transparent, align: right"]01°42'56.00
[/TD]
[TD="bgcolor: transparent, align: right"]246°41'22.00
[/TD]
[TD="bgcolor: transparent, align: right"]271°42'56.00
[/TD]
[/TR]
</tbody>[/TABLE]
I want to create a formula to find a value between a range. for example 9 degree lies in this row
[TABLE="class: grid, width: 518"]
<tbody>[TR]
[TD="bgcolor: transparent, align: right"]347°28'53.00
[/TD]
[TD="bgcolor: transparent, align: right"]18°15'04.00

[/TD]
[/TR]
</tbody>[/TABLE]
this is because after 347 it goes to 360 and then starts the counting till 18 degree and 9 degree lies in that. So I want to display the result of natal column in this case it is 3.

I have used this formula :=IF(AND($AA11 >=$G$8,$AA11 <$H$8),$B$8,IF(AND($AA11 >=$G$9,$AA11 <$H$9),$B$9,IF(AND($AA11 >=$G$10,$AA11 <$H$10),$B$10,IF(AND($AA11 >=$G$11,$AA11 <$H$11),$B$11,IF(AND($AA11 >=$G$12,$AA11 <$H$12),$B$12,IF(AND($AA11 >=$G$13,$AA11 <$H$13),$B$13,IF(AND($AA11 >=$G$14,$AA11 <$H$14),$B$14,IF(AND($AA11 >=$G$15,$AA11 <$H$15),$B$15,IF(AND($AA11 >=$G$16,$AA11 <$H$16),$B$16,IF(AND($AA11 >=$G$17,$AA11 <$H$17),$B$17,IF(AND($AA11 >=$G$18,$AA11 <$H$18),$B$18,IF(AND($AA11 >=$G$19,$AA11 <$H$19),$B$19,"Combination Not available"))))))))))))


but it is not working. I wanted to use switch formula but for some reason this does not show up in the excel 2016 so I have to use this kind of if formula. Anyway this is a second question.

Regards
Rajaniesh
 
rajaniesh,

Would you go back to your original data, and please poat what you have in the cells without custom formatting. Simply change it to "General" formatting temporarily.

Also, please tell us whether =ISNUMBER(H11) returns TRUE or FALSE.

Thank you.
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
First of All I am sorry for not replying to your request last week.

ISNUMBER(H11) returns TRUE.

Here is the text version of the table

[TABLE="class: grid, width: 518"]
<tbody>[TR]
[TD="width: 94, bgcolor: #B4C6E7"][/TD]
[TD="width: 106, bgcolor: #B4C6E7"][/TD]
[TD="width: 84, bgcolor: #B4C6E7"][/TD]
[TD="width: 100, bgcolor: #B4C6E7"][/TD]
[TD="width: 78, bgcolor: #B4C6E7"][/TD]
[TD="width: 116, bgcolor: #B4C6E7"][/TD]
[TD="width: 110, bgcolor: #B4C6E7"][/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]Natal House
[/TD]
[TD="bgcolor: #B4C6E7"]Start House(NZ)
[/TD]
[TD="bgcolor: #B4C6E7"]Degree Start
[/TD]
[TD="bgcolor: #B4C6E7"]End House(NZ)
[/TD]
[TD="bgcolor: #B4C6E7"]Degree End
[/TD]
[TD="bgcolor: #B4C6E7"]Degree Cum Start
[/TD]
[TD="bgcolor: #B4C6E7"]Degree Cum End
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]1
[/TD]
[TD="bgcolor: #B4C6E7"]10
[/TD]
[TD="bgcolor: #B4C6E7"]14256
[/TD]
[TD="bgcolor: #B4C6E7"]11
[/TD]
[TD="bgcolor: #B4C6E7"]100845
[/TD]
[TD="bgcolor: #B4C6E7"]2714256
[/TD]
[TD="bgcolor: #B4C6E7"]3100845
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]2
[/TD]
[TD="bgcolor: #B4C6E7"]11
[/TD]
[TD="bgcolor: #B4C6E7"]100845
[/TD]
[TD="bgcolor: #B4C6E7"]12
[/TD]
[TD="bgcolor: #B4C6E7"]172853
[/TD]
[TD="bgcolor: #B4C6E7"]3100845
[/TD]
[TD="bgcolor: #B4C6E7"]3472853
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]3
[/TD]
[TD="bgcolor: #B4C6E7"]12
[/TD]
[TD="bgcolor: #B4C6E7"]172853
[/TD]
[TD="bgcolor: #B4C6E7"]1
[/TD]
[TD="bgcolor: #B4C6E7"]181504
[/TD]
[TD="bgcolor: #B4C6E7"]3472853
[/TD]
[TD="bgcolor: #B4C6E7"]181504
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]4
[/TD]
[TD="bgcolor: #B4C6E7"]1
[/TD]
[TD="bgcolor: #B4C6E7"]181504
[/TD]
[TD="bgcolor: #B4C6E7"]2
[/TD]
[TD="bgcolor: #B4C6E7"]133110
[/TD]
[TD="bgcolor: #B4C6E7"]181504
[/TD]
[TD="bgcolor: #B4C6E7"]433110
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]5
[/TD]
[TD="bgcolor: #B4C6E7"]2
[/TD]
[TD="bgcolor: #B4C6E7"]133110
[/TD]
[TD="bgcolor: #B4C6E7"]3
[/TD]
[TD="bgcolor: #B4C6E7"]64122
[/TD]
[TD="bgcolor: #B4C6E7"]433110
[/TD]
[TD="bgcolor: #B4C6E7"]664122
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]6
[/TD]
[TD="bgcolor: #B4C6E7"]3
[/TD]
[TD="bgcolor: #B4C6E7"]64122
[/TD]
[TD="bgcolor: #B4C6E7"]4
[/TD]
[TD="bgcolor: #B4C6E7"]14256
[/TD]
[TD="bgcolor: #B4C6E7"]664122
[/TD]
[TD="bgcolor: #B4C6E7"]914256
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]7
[/TD]
[TD="bgcolor: #B4C6E7"]4
[/TD]
[TD="bgcolor: #B4C6E7"]14256
[/TD]
[TD="bgcolor: #B4C6E7"]5
[/TD]
[TD="bgcolor: #B4C6E7"]100845
[/TD]
[TD="bgcolor: #B4C6E7"]914256
[/TD]
[TD="bgcolor: #B4C6E7"]1300845
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]8
[/TD]
[TD="bgcolor: #B4C6E7"]5
[/TD]
[TD="bgcolor: #B4C6E7"]100845
[/TD]
[TD="bgcolor: #B4C6E7"]6
[/TD]
[TD="bgcolor: #B4C6E7"]172853
[/TD]
[TD="bgcolor: #B4C6E7"]1300845
[/TD]
[TD="bgcolor: #B4C6E7"]1672853
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]9
[/TD]
[TD="bgcolor: #B4C6E7"]6
[/TD]
[TD="bgcolor: #B4C6E7"]172853
[/TD]
[TD="bgcolor: #B4C6E7"]7
[/TD]
[TD="bgcolor: #B4C6E7"]181504
[/TD]
[TD="bgcolor: #B4C6E7"]1672853
[/TD]
[TD="bgcolor: #B4C6E7"]1981504
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]10
[/TD]
[TD="bgcolor: #B4C6E7"]7
[/TD]
[TD="bgcolor: #B4C6E7"]181504
[/TD]
[TD="bgcolor: #B4C6E7"]8
[/TD]
[TD="bgcolor: #B4C6E7"]133110
[/TD]
[TD="bgcolor: #B4C6E7"]1981504
[/TD]
[TD="bgcolor: #B4C6E7"]2233110
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]11
[/TD]
[TD="bgcolor: #B4C6E7"]8
[/TD]
[TD="bgcolor: #B4C6E7"]133110
[/TD]
[TD="bgcolor: #B4C6E7"]9
[/TD]
[TD="bgcolor: #B4C6E7"]64122
[/TD]
[TD="bgcolor: #B4C6E7"]2233110
[/TD]
[TD="bgcolor: #B4C6E7"]2464122
[/TD]
[/TR]
[TR]
[TD="bgcolor: #B4C6E7"]12
[/TD]
[TD="bgcolor: #B4C6E7"]9
[/TD]
[TD="bgcolor: #B4C6E7"]64122
[/TD]
[TD="bgcolor: #B4C6E7"]10
[/TD]
[TD="bgcolor: #B4C6E7"]14256
[/TD]
[TD="bgcolor: #B4C6E7"]2464122
[/TD]
[TD="bgcolor: #B4C6E7"]2714256
[/TD]
[/TR]
</tbody>[/TABLE]

Please let me know if you need something else?

Regards
Rajaniesh
 
Last edited:
Upvote 0
OK. Do not use any of the text to number conversion formulas. The lookup table is still in columns P & Q


Book1
PQZAAAB
10LookupHouseFindAnswer
1103900003
1218150443900004
1343311056900006
1466412269900007
15914256712900007
161300845815900008
171672853918900009
18198150410219000010
19223311011239000011
20246412212269000012
212714256129900001
223100845232900002
233472853335959593
Sheet1
Cell Formulas
RangeFormula
AB11=VLOOKUP($AA11, $P$11:$Q$23, 2, TRUE)

You can apply your custom formatting to the values in column P and it should still work.
 
Upvote 0
Sir,

It is still not working


[TABLE="class: grid, width: 1054"]
<tbody>[TR]
[TD]Degree Start (Decimal)
[/TD]
[TD]Degree End (Decimal)
[/TD]
[TD]Look Up value
[/TD]
[TD]Natal House
[/TD]
[TD]Lookup Value in Degree
[/TD]
[TD]Result
[/TD]
[/TR]
[TR]
[TD="align: right"]2714256
[/TD]
[TD="align: right"]3100845
[/TD]
[TD][/TD]
[TD="align: right"]1
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3100845
[/TD]
[TD="align: right"]3472853
[/TD]
[TD][/TD]
[TD="align: right"]2
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3472853
[/TD]
[TD="align: right"]181504
[/TD]
[TD][/TD]
[TD="align: right"]3
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]181504
[/TD]
[TD="align: right"]433110
[/TD]
[TD][/TD]
[TD="align: right"]4
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]433110
[/TD]
[TD="align: right"]664122
[/TD]
[TD="align: right"]2225320
[/TD]
[TD="align: right"]5
[/TD]
[TD="align: right"]222°53'20.00
[/TD]
[TD="align: right"]-10
[/TD]
[/TR]
[TR]
[TD="align: right"]664122
[/TD]
[TD="align: right"]914256
[/TD]
[TD][/TD]
[TD="align: right"]6
[/TD]
[TD][/TD]
[TD="align: center"]#N/A
[/TD]
[/TR]
[TR]
[TD="align: right"]914256
[/TD]
[TD="align: right"]1300845
[/TD]
[TD][/TD]
[TD="align: right"]7
[/TD]
[TD][/TD]
[TD="align: center"]#N/A
[/TD]
[/TR]
[TR]
[TD="align: right"]1300845
[/TD]
[TD="align: right"]1672853
[/TD]
[TD="align: right"]2940640
[/TD]
[TD="align: right"]8
[/TD]
[TD="align: right"]294°06'40.00
[/TD]
[TD="align: right"]-12
[/TD]
[/TR]
[TR]
[TD="align: right"]1672853
[/TD]
[TD="align: right"]1981504
[/TD]
[TD="align: right"]3191320
[/TD]
[TD="align: right"]9
[/TD]
[TD="align: right"]319°13'20.00
[/TD]
[TD="align: right"]-12
[/TD]
[/TR]
[TR]
[TD="align: right"]1981504
[/TD]
[TD="align: right"]2233110
[/TD]
[TD="align: right"]92000
[/TD]
[TD="align: right"]10
[/TD]
[TD="align: right"]09°20'00.00
[/TD]
[TD="align: center"]#N/A
[/TD]
[/TR]
[TR]
[TD="align: right"]2233110
[/TD]
[TD="align: right"]2464122
[/TD]
[TD][/TD]
[TD="align: right"]11
[/TD]
[TD][/TD]
[TD="align: center"]#N/A
[/TD]
[/TR]
[TR]
[TD="align: right"]2464122
[/TD]
[TD="align: right"]2714256
[/TD]
[TD][/TD]
[TD="align: right"]12
[/TD]
[TD][/TD]
[TD="align: center"]#N/A
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Oh! You do not want to set up a separate lookup table.

See if this works —
=LOOKUP($AA22,{0,181504,433110,664122,914256,1300845,1672853,1981504,2233110,2464122,2714256,3100845,3472853},{3,4,5,6,7,8,9,10,11,12,1,2,3})
 
Upvote 0
Sir,

What logic is used to keep 0 to 3rd house which is not correct. In this formula we need to put everything in the descending order for it to work but in real scenario it may not happen and it may not work if we keep it non sorted order.

Regards
Rajaniesh
 
Upvote 0
I think I finally understand. The table in columns B through H will change; the values are not constant. We need to do a lookup with reference values that will change.

Natal House is in B8:B19.
Degree Cum End is in H8:H19.

The formula in K8 is copied downward.
M8 is a constant, zero.
The formula in M9 is copied downward.
N8 and N9 contain different formulas.
The formula in N9 is copied downward through N20.


Book1
JKLMN
6TestsLookup Table
7FindResultRanked DCMHouse
890000303
939000041815044
1048000054331105
1169000066641226
1299000079142567
131290000713008458
141590000816728539
1518900009198150410
16219000010223311011
17249000012246412212
182790000127142561
193090000131008452
203390000234728533
2113
2235959593
GeneralFormat
Cell Formulas
RangeFormula
K8=VLOOKUP($J8,$M$8:$N$20,2,TRUE)
N8=INDEX($B$8:$B$19, MATCH($M9, $H$8:$H$19, 0))
N9=IF(N8=12, 1, N8 + 1)
M9=SMALL($H$8:$H$19, ROW() - ROW($M$8))

https://www.dropbox.com/s/0o2ha8er2idcrkm/natal_house_lookup_for_rajaniesh_v2.xlsx?dl=0
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,020
Members
452,542
Latest member
Bricklin

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