Looking to modify the below formula.
If the value of the formula = negative number return a value of 0
Please Login or Register to view this content.
Looking to modify the below formula.
If the value of the formula = negative number return a value of 0
Please Login or Register to view this content.
Last edited by SVTF; 10-26-2014 at 09:27 PM.
If you want neg either way to show NA, then perhaps this...
=IF(and(I2="",B2=""),"NA",MAX($B$2,I2)-MIN($B$2,I2))
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Thanks but the above changed the value from -54 to positive 54
OK well you have 2 numbers and your formula is swapping them around. Which way round do you wantthe formula to calc?
Hmm .. I am going crazy.
Last edited by SVTF; 10-26-2014 at 08:50 PM.
that still gives 0 for b2=i2
"Unless otherwise stated all my comments are directed at OP"
Mojito connoisseur and now happily retired
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
I think I am on crack tonight. Been trying to get this sheet to work for way to long.
another try
=IF(I2="",IF(B2="","NA",IF($B$2-B2<=0,"na",$B$2-B2)),IF(I2-B2<=0,"na",I2-B2))
This formula ... works as needed
=IF(I2="",IF(B2="","NA",$B$2-B2),I2-B2)
What I an looking to do is if the result is negative - return 0
If which 1 returns negative? Because depending on the outcome of the IF's, either 1 could be negative
The I2-B2 If statement.
put max around it
max(i2-b2,0)
@martindwilson - seems to be working as needed ... stay tuned for rep.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks