conditional equations

gryffynwolf

New Member
Joined
Jul 10, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I am needing a code to do 2 different calculations based on a number. I have 1 cell where I have a positive or negative number. If the input is positive (i.e. 2.35) the equation needs to be (((360+the input cell)/10)-180)*60, if the input number is negative (i.e. -3.45) I need it to do the equation ((input cell/10)-180)*60. I need it to display a resultant number based off the result, is this possible?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Maybe this assuming your input cell is A1
Excel Formula:
=IF(A1>0,((360+A1)/10-180)*60,((A1/10)-180)*60)
 
Upvote 0
it doesn't work but its my fault i see where my question was wrong i need it to use the calculation where it adds 360 if its greater than 0 and use the one without adding the 360 if its less that 360 as in degrees so if its .235 it adds 360 to the calc, if its 359.456 it wouldn't. sorry...
 
Upvote 0
not in this case, it would be 0.235 degrees i would need the calculation to add 360, whereas if its 359.554 degrees i wouldn't need to add it. im trying to do utilize 1 cell (say A3) to use one or the other equation depending on what i put into cell A1. its due to a piece of measuring equipment
 
Upvote 0
i do see what your saying though.. could i use a if its between 0 - 10 degrees it would add the 360, or 350 - 360 it wouldnt?
 
Upvote 0
check me but i think this may work
=IF(AND(D25>0,D25<10),((360+D25)/2-C25)*60,IF(AND(D25>350,D25<360),((D25/2)-C25)*60))
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,306
Members
449,095
Latest member
Chestertim

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