Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default cell formulas

I'm working on two columns of percentages - cost and profit. Occassionally,
the numbers are weird and so the percentages are either negative or extremely
large. What kind of code can I write so that, if the numbers are not within
a certain range,a default number is entered?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default cell formulas

If you refer to your percentage calculation/formula as "ypc", the formula
might look like:

=IF(OR(ypc<low limit, ypchigh limit),default value,ypc)

Regards

Trevor


"TechyTemp" wrote in message
...
I'm working on two columns of percentages - cost and profit.
Occassionally,
the numbers are weird and so the percentages are either negative or
extremely
large. What kind of code can I write so that, if the numbers are not
within
a certain range,a default number is entered?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default cell formulas

Please post your formulas or code, and an example of what you mean by
"weird" and "extremely large". Are you looking for a formula or a VBA
formula?

Alan


"The only dumb question is a question left unasked."


"TechyTemp" wrote in message
...
I'm working on two columns of percentages - cost and profit.
Occassionally,
the numbers are weird and so the percentages are either negative or
extremely
large. What kind of code can I write so that, if the numbers are not
within
a certain range,a default number is entered?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default cell formulas

one way:

=IF(OR(A1/B1<50%, A1/B1100%),<default number,A1/B1)

An alternative:

to bound the values to within 50%-100%:

=MAX(50%,MIN(100%,A1/B1))

In article ,
TechyTemp wrote:

I'm working on two columns of percentages - cost and profit. Occassionally,
the numbers are weird and so the percentages are either negative or extremely
large. What kind of code can I write so that, if the numbers are not within
a certain range,a default number is entered?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 740
Default cell formulas

we may filter it also,,by drilling down the default values for the hi and low
% limits as explained by Trevor..
something like for cost_% on column A
C1=if(A1< min_%,min_%,if(A1max_%,max_%,A1)
and same principle for profit_% on column B..
regards
--
*****
birds of the same feather flock together..



"Trevor Shuttleworth" wrote:

If you refer to your percentage calculation/formula as "ypc", the formula
might look like:

=IF(OR(ypc<low limit, ypchigh limit),default value,ypc)

Regards

Trevor


"TechyTemp" wrote in message
...
I'm working on two columns of percentages - cost and profit.
Occassionally,
the numbers are weird and so the percentages are either negative or
extremely
large. What kind of code can I write so that, if the numbers are not
within
a certain range,a default number is entered?




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
Two formulas in on cell based on two numbers in another cell? Melody Excel Discussion (Misc queries) 5 March 19th 10 07:51 PM
Carrying formulas over to new cell when old cell is deleted: possi Karl Excel Worksheet Functions 0 June 24th 08 01:10 PM
How to trace a cell? Which cells use a special cell in formulas? SupperDuck Excel Discussion (Misc queries) 4 December 1st 06 04:17 PM
Copying formulas from cell to cell to cell to....... Tom Hardy Excel Discussion (Misc queries) 3 June 15th 06 03:29 PM
change cell value greater than another cell value using formulas Unsure? Excel Worksheet Functions 2 April 2nd 06 10:24 PM


All times are GMT +1. The time now is 06:56 AM.

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"