• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Formula to convert range of positive & negative numbers to degrees

Hi,

In the attached file, in column D (Scale), I am trying to determine a formula to convert a range of numbers to degrees. The table in yellow might summarize better what I'm trying to do. In column D. I entered the values from I10:M10 to help make things clearer about what I'm trying to do in column D.

Not only is my range positive to negative (15 to -15), I also have that range come up (-15 to 15) in the last 180 degrees.

Can anybody point me in the right direction?
 

Attachments

  • Chandoo.org - Degrees.xlsx
    14.3 KB · Views: 8
If you have Excel 2021, 2024 or 365, paste this into E6 and hit ENTER:

Code:
=LET(x,IF(C6:C186=90,0,-SEQUENCE(181,,-15,60/360)),
y,IFNA(IF(C187:C366=270,0,SEQUENCE(181,,-15,60/360)),15),
VSTACK(x,DROP(y,1)))
 
Or this:

Code:
=LET(s,I10,m,K10,x,IF(C6:C186=90,0,-SEQUENCE(181,,m,60/360)),
y,IFNA(IF(C187:C366=270,0,SEQUENCE(181,,m,60/360)),s),
VSTACK(x,DROP(y,1)))
 

Attachments

  • DashboardNovice Chandoo.org - Degrees SPILL 2021 AliGW.xlsx
    19.4 KB · Views: 5
It might depend on how you want the scale to read:

1743329652301.png

If like the blue line, one of AliGW's formulae [or =ABS(C6:C366/6-30)-15 ],
if like the orange line then in D6:
=COS(C6:C366*PI()/180)*15
or in older versions of Excel:
=COS(C6*PI()/180)*15
copied down.
 
Last edited:
If you have Excel 2021, 2024 or 365, paste this into E6 and hit ENTER:

Code:
=LET(x,IF(C6:C186=90,0,-SEQUENCE(181,,-15,60/360)),
y,IFNA(IF(C187:C366=270,0,SEQUENCE(181,,-15,60/360)),15),
VSTACK(x,DROP(y,1)))
I have Microsoft Office Home and Business 2021. I tried this code and I got a #NAME? error.

This is really deep. I haven't seen most of these functions.
 
See posts #2 and #3 for the difference - same results, though.

Sorry - I forgot that 2021 does not have VSTACK.

Go with this from @p45cal in post #4:

=ABS(C6:C366/6-30)-15
 
Back
Top