Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

Limit the Value of a Cell to only Negative

Hello,

I would like to limit the value of a cell to only be negative.  
I have a formula in this cell
=IFERROR(VLOOKUP("*Interest exp*",IncomeStmnt!$A$3:$L$56,2,0),0)

Therefore it is not a manuel entry.  
I know I can limit to only negative if I actually typed a number into the cell but this is not the case.

How can I limit the value of the cell to only negative if there is a formula in the cell?
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

What should happen if the value is negative?
Perhaps simply:

=MIN(IFERROR(VLOOKUP("*Interest exp*",IncomeStmnt!$A$3:$L$56,2,0),0),0)
ASKER CERTIFIED SOLUTION
Avatar of Leo Torres
Leo Torres
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Worksheet_Change will not be triggered by a formula calculation though - you would need the Calculate event.
Good point rorya:

I im out of shape on VBA its been a while..

Thanks.. but the logic remains the same it should still work

:)
Avatar of pdvsa

ASKER

Sorry for my late reply.  I have been very busy with my "real" job.  I hope to test in a few hours when i am at a computer.   Thank you
Avatar of pdvsa

ASKER

Hi, I would rather not have a VBA enabled excel file (if possible).  A warning message is not absolutely necessary but it nice to have but I think the only way to have that is by VBA but what do I know (not much).  If the file is distributed, otheres will not know what to do when they get the enable macros security message.  

I am not sure if the formula by rorya changes the value to negative in cell:  (VLOOKUP("*Interest exp*",IncomeStmnt!$A$3:$L$56,2   if it was positive?

thank you.
If you simply want the positive value of that number then you can use

=abs(IFERROR(VLOOKUP("*Interest exp*",IncomeStmnt!$A$3:$L$56,2,0),0))
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdvsa

ASKER

I decided to award points to two experts.  I hope that is fair.   I did not say in my initial question I was not interested in VBA.   I thought of this afterwards.  Thank you.

Rorya:  that worked perfectly!