Calculating new value based on range of set criteria

Flyingcat

New Member
Joined
Aug 13, 2011
Messages
2
Would highly appreciate any help on this. I have tried for a number of hours but can't seem to find a solution.

I'm trying to calculate a new value if a calculated value in a cell is less than 0 or greater than 360.

The conditions are:

If the cell's value is equal to or between 0 and 360 then no calculation is required.

If the cell's value is less than zero then 360 has to be added to the cell's value.

If the the cell's value is greater than 360 then 360 has to subtracted from the cell's value.

For example:

1) If the calculated cell value in A1 is 100 then B1 would show 100

2) If the calculated cell value in A1 was -10 (minus 10) then B1 would show 350 i.e. (-10+350)

3) If the calculated cell value in A1 was 370 then B1 would show 10 i.e. (370-360)

Any idea what formula I should use in cell B1 to accomplish this?

Thanks in advance.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Would highly appreciate any help on this. I have tried for a number of hours but can't seem to find a solution.

I'm trying to calculate a new value if a calculated value in a cell is less than 0 or greater than 360.

The conditions are:

If the cell's value is equal to or between 0 and 360 then no calculation is required.

If the cell's value is less than zero then 360 has to be added to the cell's value.

If the the cell's value is greater than 360 then 360 has to subtracted from the cell's value.

For example:

1) If the calculated cell value in A1 is 100 then B1 would show 100

2) If the calculated cell value in A1 was -10 (minus 10) then B1 would show 350 i.e. (-10+350)

3) If the calculated cell value in A1 was 370 then B1 would show 10 i.e. (370-360)

Any idea what formula I should use in cell B1 to accomplish this?

Thanks in advance.
I think this should do it...

=IF(A1<0,A1+360,IF(A1>360,A1-360,A1))
 
Upvote 0
Hi Biff,

Many thanks for your quick response, elegant formula and also for taking the time to reply, it works perfectly. Much appreciated.

Frank.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
rootytrip

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