• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Percentage Formula

shaherukh

New Member
Hi,
how can we put a formula to calculate percentage & then drag it down to all the cells.
When I am putting percentage formula in first cell then it showing correct answer but when I am dragging it to below cells then it is showing error in cells with zero value.
 
Hello Shaherukh,

Let's say you have below values;

A1 = 1, B1 = 2

Then in C1 : =A1/B1 = 50%

A2 = 1, B2 = 0

C2: =A2/B2 =#DIV/0!

The error because you are dividing a value by zero. If this is your issue; you can use IFERROR

=IFERROR(A1/B1,0)

So this way will display zero instead of error

or if you have a total cell at bottom ie: A10 then you are using cell value/Total

=A1/A10

You have to use absolute reference to A10. otherwise when copy down A10 will be, A11, A12, A13....

So you have use A1/A$10 (a $ sign require here to stop changing the reference)
 
Hi Dear,
Hello Shaherukh,

Let's say you have below values;

A1 = 1, B1 = 2

Then in C1 : =A1/B1 = 50%

A2 = 1, B2 = 0

C2: =A2/B2 =#DIV/0!

The error because you are dividing a value by zero. If this is your issue; you can use IFERROR

=IFERROR(A1/B1,0)

So this way will display zero instead of error

or if you have a total cell at bottom ie: A10 then you are using cell value/Total

=A1/A10

You have to use absolute reference to A10. otherwise when copy down A10 will be, A11, A12, A13....

So you have use A1/A$10 (a $ sign require here to stop changing the reference)

Hello Shaherukh,

Let's say you have below values;

A1 = 1, B1 = 2

Then in C1 : =A1/B1 = 50%

A2 = 1, B2 = 0

C2: =A2/B2 =#DIV/0!

The error because you are dividing a value by zero. If this is your issue; you can use IFERROR

=IFERROR(A1/B1,0)

So this way will display zero instead of error

or if you have a total cell at bottom ie: A10 then you are using cell value/Total

=A1/A10

You have to use absolute reference to A10. otherwise when copy down A10 will be, A11, A12, A13....

So you have use A1/A$10 (a $ sign require here to stop changing the reference)




Hi Dear,
It did not work.

screen shot has been mentioned below for your reference.

Kindly go through the remarks.

upload_2014-10-6_2-39-35.png
 
You are getting the 0% because of division by 0 try to put an if condition to ur formula to tackle this issue , again it should be based on what you want to report out.
 
Hi ,

A formula will do what it is supposed to do ; it is up to the person who develops the formula to ensure that the formula is written to do what they want to do.

You have to first formulate the logic ; then develop the formula according to that logic.

You want a percentage value ; you wish to divide a value A by another value B. There are now 4 possibilities :

1. Both A and B are non-zero

2. A is non-zero , while B is zero

3. A is zero , while B is non-zero

4. Both A and B are zero.

Can you first explain what you want as the output in each of the above 4 cases ?

Narayan
 
Back
Top