Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
KMHarpe
 
Posts: n/a
Default Want to calculate a percentage by dividing one cell by the other,

I want to calculate a percentage, but don't want it to calculate if the cells
have a zero OR Negative numbers. How do I do this?

  #3   Report Post  
 
Posts: n/a
Default



Nick Hodge wrote:
"KMHarpe" wrote:
I want to calculate a percentage, but don't want it to
calculate if the cells have a zero OR Negative numbers.
How do I do this?


=if(A1<=0,0,A1/B1)


More precisely (because the OP said "cells"):

=if(or(A1<=0,B1<=0), 0, A1/B1)

and format the cell appropriately.

But the OP was unclear about what to do when the "cells"
are zero or negative. Nick's solution puts a zero into
the "percentage" cell. If you want the cell to remain
empty, simply do:

=if(or(A1<=0,B1<=0), "", A1/B1)

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
HOW DO I CALCULATE A RUNNING PERCENTAGE fniguy24095 Excel Discussion (Misc queries) 1 May 4th 05 08:12 PM
calculate monthly average percentage of change vikgarden Excel Worksheet Functions 2 April 15th 05 07:38 PM
Calculate percentage based on cells with conditional formatting Cachod1 New Users to Excel 5 April 4th 05 02:11 PM
calculate percentage JP Excel Worksheet Functions 6 March 2nd 05 02:34 PM
How do I create a formula to calculate the average percentage rat LD Excel Worksheet Functions 5 January 13th 05 06:17 PM


All times are GMT +1. The time now is 06:44 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"