if between positive and negative statement

orsm6

Active Member
Joined
Oct 3, 2012
Messages
496
Office Version
  1. 365
Platform
  1. Windows
Hi - i can get this working in various ways but i can't seem to nail my solution in one formula. trying to an if between formula that if the value of D5 is between -1 and 1 the result is 0.01... BUT

if D5 is a negative number and between -1 and 1 the answer will be -0.01
if D5 is a positive number and between -1 and 1 the answer will be 0.01

the answer is in a column that calculates cost which is why if D is a negative number i need the cost to also be negative result.

TIA
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
i finally stumbled on my answer.... this seems to work =IF(D1<-1,-0.01,IF(D1<1,0.01,(D1*E1)/F1))

EDIT: no i didn't any value e.g. -2.22 with formula above still changes it to -0.01
 
Upvote 0
What happens if D5 is outside that range?
Also what happens if D5 is 0?
 
Upvote 0
What happens if D5 is outside that range?
Also what happens if D5 is 0?
hi Fluff - so column D there is already a value (it is my quantities column) so if the value in D is NOT between -1 and 1 then the formula calculates the cost based on the value in D.....

if the value in D is between -1 and 1 i want to put either -0.01 or 0.01 in the cost column.

HTH.
 
Upvote 0
How about
=IF(ABS(D1)<1,SIGN(D1)*0.01,(D1*E1)/F1)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,389
Messages
6,119,232
Members
448,879
Latest member
VanGirl

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