Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jcoleman52
 
Posts: n/a
Default Making Negative Results Default to Zero


I have an Excel application involving several worksheets and numerous
lengthy formulas, with results that are passed on to subsequent
calculations in other sheets. Due to the nature of the data, any
results less than zero must be set to zero for calculations that
follow. I could of course put in each formula, IF(‘humongous formula’
< 0,0,’humongous formula’), but this would require considerable effort
across all the sheets, and there are other constraints as well, so it
would become an exercise in IF, ELSE, ELSE, ELSE…..etc. I was
wondering if there is a worksheet or workbook parameter that can be set
that will not allow values less than zero in any cell, so that if a
formula calculation yields a result less than zero, the cell is
automatically set to zero? Would there be a way to do it through VBA
language? Thanks.


--
jcoleman52
------------------------------------------------------------------------
jcoleman52's Profile: http://www.excelforum.com/member.php...o&userid=29498
View this thread: http://www.excelforum.com/showthread...hreadid=495495

  #2   Report Post  
Posted to microsoft.public.excel.misc
JE McGimpsey
 
Posts: n/a
Default Making Negative Results Default to Zero

First, you could use

=MAX(0,<humongous formula)

which has the benefit of only calculating the h.f. once. I don't know
how it would affect your other constraints.

If you replace formulae resulting in negative numbers with zeros using
VBA, you'll lose the formulae. In addition, it would likely be very
difficult to get the dependencies right if the formulae are
interdependent. I'm also not sure it would deal with your other
constraints.


In article ,
jcoleman52
wrote:

I have an Excel application involving several worksheets and numerous
lengthy formulas, with results that are passed on to subsequent
calculations in other sheets. Due to the nature of the data, any
results less than zero must be set to zero for calculations that
follow. I could of course put in each formula, IF(‘humongous formula’
< 0,0,’humongous formula’), but this would require considerable effort
across all the sheets, and there are other constraints as well, so it
would become an exercise in IF, ELSE, ELSE, ELSE…..etc. I was
wondering if there is a worksheet or workbook parameter that can be set
that will not allow values less than zero in any cell, so that if a
formula calculation yields a result less than zero, the cell is
automatically set to zero? Would there be a way to do it through VBA
language? Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
abdualmohsn almedrahe abdualmohsn ahmad Excel Discussion (Misc queries) 1 November 19th 05 06:32 PM
Negative Results Denise Excel Discussion (Misc queries) 2 October 7th 05 09:17 PM
with formulas that show negative results I want to show zero inste brit64 Excel Discussion (Misc queries) 6 August 29th 05 11:12 PM
problem:search results negative in excel docs with macros spirit39 Excel Discussion (Misc queries) 0 February 10th 05 11:01 PM
Track Changes: Making "All" the default Bettergains Excel Discussion (Misc queries) 0 January 11th 05 09:35 PM


All times are GMT +1. The time now is 08:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"