ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF and OR functions (https://www.excelbanter.com/excel-discussion-misc-queries/186826-if-functions.html)

F. Lawrence Kulchar

IF and OR functions
 
I have this formula typed into a cell:

=IF((C10+B26)180,C10+B26-360,C10+B26)

AND...it works fine; however, I have to add the following parameter to the
same cell:

= IF((C10+B26)<180,C10+B26+360,C10+B26)

Please notice the subtle differences..I am working with a global 360 degree
sphere wherein when values are combined, I can be maxed at positive
(+179.999) degrees or minimized at negative (-179.999) degrees.

I tried the "OR" function outside my "IF" function, but all I got was "TRUE"
for the answer..not an actual number.

PLEASE OFFER THE CORRECT FORMULA.

Thank you,

FLKulchar

FLKulchar

IF and OR functions
 
I have figured it out on my own...simply, I "nested" the 'IF' functions.

Thanks,

FLKulchar
"F. Lawrence Kulchar" wrote in
message ...
I have this formula typed into a cell:

=IF((C10+B26)180,C10+B26-360,C10+B26)

AND...it works fine; however, I have to add the following parameter to the
same cell:

= IF((C10+B26)<180,C10+B26+360,C10+B26)

Please notice the subtle differences..I am working with a global 360
degree
sphere wherein when values are combined, I can be maxed at positive
(+179.999) degrees or minimized at negative (-179.999) degrees.

I tried the "OR" function outside my "IF" function, but all I got was
"TRUE"
for the answer..not an actual number.

PLEASE OFFER THE CORRECT FORMULA.

Thank you,

FLKulchar




joel

IF and OR functions
 
Try lookup instead

=lookup((C10+B26),{-180,180,360;C10+B26+360,C10+B26,C10+B26-360})

"F. Lawrence Kulchar" wrote:

I have this formula typed into a cell:

=IF((C10+B26)180,C10+B26-360,C10+B26)

AND...it works fine; however, I have to add the following parameter to the
same cell:

= IF((C10+B26)<180,C10+B26+360,C10+B26)

Please notice the subtle differences..I am working with a global 360 degree
sphere wherein when values are combined, I can be maxed at positive
(+179.999) degrees or minimized at negative (-179.999) degrees.

I tried the "OR" function outside my "IF" function, but all I got was "TRUE"
for the answer..not an actual number.

PLEASE OFFER THE CORRECT FORMULA.

Thank you,

FLKulchar


FLKulchar

IF and OR functions
 
Joel:

I cannot get your array "lookup" formula to work -- I get an error message
with the C10 +B26+360 bit of info.

Please explain please!

Thanks,

FLKulchar
"Joel" wrote in message
...
Try lookup instead

=lookup((C10+B26),{-180,180,360;C10+B26+360,C10+B26,C10+B26-360})

"F. Lawrence Kulchar" wrote:

I have this formula typed into a cell:

=IF((C10+B26)180,C10+B26-360,C10+B26)

AND...it works fine; however, I have to add the following parameter to
the
same cell:

= IF((C10+B26)<180,C10+B26+360,C10+B26)

Please notice the subtle differences..I am working with a global 360
degree
sphere wherein when values are combined, I can be maxed at positive
(+179.999) degrees or minimized at negative (-179.999) degrees.

I tried the "OR" function outside my "IF" function, but all I got was
"TRUE"
for the answer..not an actual number.

PLEASE OFFER THE CORRECT FORMULA.

Thank you,

FLKulchar




FLKulchar

IF and OR functions
 
HERE IS THE CORRECTED nested "IF" FUNCTION ANSWER:

=IF((C10+B26)=180,C10+B26-360,IF((C10+B26)<=-180,C10+B26+360,C10+B26))

THERE WE GO..IT WORKS:

As to the LOOKUP function, I do NOT comprehend it, i.e. I cannot get it to
work!


Thanks,

FLKulchar


"F. Lawrence Kulchar" wrote in
message ...
I have this formula typed into a cell:

=IF((C10+B26)180,C10+B26-360,C10+B26)

AND...it works fine; however, I have to add the following parameter to the
same cell:

= IF((C10+B26)<180,C10+B26+360,C10+B26)

Please notice the subtle differences..I am working with a global 360
degree
sphere wherein when values are combined, I can be maxed at positive
(+179.999) degrees or minimized at negative (-179.999) degrees.

I tried the "OR" function outside my "IF" function, but all I got was
"TRUE"
for the answer..not an actual number.

PLEASE OFFER THE CORRECT FORMULA.

Thank you,

FLKulchar




FLKulchar

IF and OR functions
 
Joel:

This solution you suggested:

Try lookup instead

=lookup((C10+B26),{-180,180,360;C10+B26+360,C10+B26,C10+B26-360})


does NOT seem to work, as my EXCEL does not recognize the C10+B26 as part of
the array...any explanations?

Thanks,

FLKulchar

"Joel" wrote in message
...
Try lookup instead

=lookup((C10+B26),{-180,180,360;C10+B26+360,C10+B26,C10+B26-360})

"F. Lawrence Kulchar" wrote:

I have this formula typed into a cell:

=IF((C10+B26)180,C10+B26-360,C10+B26)

AND...it works fine; however, I have to add the following parameter to
the
same cell:

= IF((C10+B26)<180,C10+B26+360,C10+B26)

Please notice the subtle differences..I am working with a global 360
degree
sphere wherein when values are combined, I can be maxed at positive
(+179.999) degrees or minimized at negative (-179.999) degrees.

I tried the "OR" function outside my "IF" function, but all I got was
"TRUE"
for the answer..not an actual number.

PLEASE OFFER THE CORRECT FORMULA.

Thank you,

FLKulchar





All times are GMT +1. The time now is 05:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com