Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JN JN is offline
external usenet poster
 
Posts: 29
Default Nesting IF/calculate percentage

Could anyone help me with a formula that would compare Col B & Col C and
return the information in Col D?


Col B Col C Col D
950.91 950.91 0%
0 0 0
0 330.41 100%
1.96 11.05 463.8%


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Nesting IF/calculate percentage

On Apr 9, 3:14 pm, JN wrote:
Could anyone help me with a formula that would compare Col B & Col C and
return the information in Col D?
Col B Col C Col D
950.91 950.91 0%
0 0 0
0 330.41 100%
1.96 11.05 463.8%


In D1 and copy down:

=if(B1=0, 100%, C1/B1 -1)

Format the cell as Percentage with the desired number of decimal
places.

Not everyone would agree that if B1 is zero, 100% is the right
answer. But that is what you asked for.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JN JN is offline
external usenet poster
 
Posts: 29
Default Nesting IF/calculate percentage

I'm sorry, I wasn't being very clear. I need 1 formula that would cover all
3 scenarios -

1) if Col B & C are equal, then return 0
2) if Col B = 0, then return 100% regardless of value of Col C
3) ABS value of Col B & Col C

"joeu2004" wrote:

On Apr 9, 3:14 pm, JN wrote:
Could anyone help me with a formula that would compare Col B & Col C and
return the information in Col D?
Col B Col C Col D
950.91 950.91 0%
0 0 0
0 330.41 100%
1.96 11.05 463.8%


In D1 and copy down:

=if(B1=0, 100%, C1/B1 -1)

Format the cell as Percentage with the desired number of decimal
places.

Not everyone would agree that if B1 is zero, 100% is the right
answer. But that is what you asked for.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JN JN is offline
external usenet poster
 
Posts: 29
Default Nesting IF/calculate percentage

This formula works fine until I run into 0 & then I get the #DIV/0! error:

=IF(B3=C3,"0% ",C3-B3)/ABS(B3)


"JN" wrote:

I'm sorry, I wasn't being very clear. I need 1 formula that would cover all
3 scenarios -

1) if Col B & C are equal, then return 0
2) if Col B = 0, then return 100% regardless of value of Col C
3) ABS value of Col B & Col C

"joeu2004" wrote:

On Apr 9, 3:14 pm, JN wrote:
Could anyone help me with a formula that would compare Col B & Col C and
return the information in Col D?
Col B Col C Col D
950.91 950.91 0%
0 0 0
0 330.41 100%
1.96 11.05 463.8%


In D1 and copy down:

=if(B1=0, 100%, C1/B1 -1)

Format the cell as Percentage with the desired number of decimal
places.

Not everyone would agree that if B1 is zero, 100% is the right
answer. But that is what you asked for.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Nesting IF/calculate percentage

On Apr 9, 4:38 pm, JN wrote:
I'm sorry, I wasn't being very clear. I need 1 formula that would cover all
3 scenarios -
1) if Col B & C are equal, then return 0


No, my mistake. Your examples were quite clear. I overlooked this
case. Try the following:

=if(B1=0, if(C1=0, 0%, 100%), C1/B1 - 1)

Again, format as Percentage with the desired number of decimal places.

3) ABS value of Col B & Col C


This requirement does not make sense to me; and it does not seem to
jibe with any of your examples. I wonder if it is simply an over-
specification.

Or are you trying to cover cases where either B or C, or where both B
and C, are negative?

If so, please provide examples with the percentage change that you
would like to see.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JN JN is offline
external usenet poster
 
Posts: 29
Default Nesting IF/calculate percentage

I was trying to calculate the difference between 2 #s as a percentage and was
using the above formula with the IF statement

HOWEVER you provided me with perfection and I'm very, very happy! Thank you
so much!

"joeu2004" wrote:

On Apr 9, 4:38 pm, JN wrote:
I'm sorry, I wasn't being very clear. I need 1 formula that would cover all
3 scenarios -
1) if Col B & C are equal, then return 0


No, my mistake. Your examples were quite clear. I overlooked this
case. Try the following:

=if(B1=0, if(C1=0, 0%, 100%), C1/B1 - 1)

Again, format as Percentage with the desired number of decimal places.

3) ABS value of Col B & Col C


This requirement does not make sense to me; and it does not seem to
jibe with any of your examples. I wonder if it is simply an over-
specification.

Or are you trying to cover cases where either B or C, or where both B
and C, are negative?

If so, please provide examples with the percentage change that you
would like to see.


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Nesting IF/calculate percentage

On Apr 10, 7:22 am, JN wrote:
"joeu2004" wrote:
On Apr 9, 4:38 pm, JN wrote:
Try the following:
=if(B1=0, if(C1=0, 0%, 100%), C1/B1 - 1)


I was trying to calculate the difference between 2 #s as a percentage and was
using the above formula with the IF statement

HOWEVER you provided me with perfection and I'm very, very happy! Thank you
so much!


You're welcome! Glad to hear that works well for you. FYI, here is
another expression of the same solution. Use whichever one is easier
for you to use:

=if(B1=0, (C1<0)*100%, C1/B1 - 1)

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
calculate percentage in pivot dan Excel Discussion (Misc queries) 1 September 22nd 06 04:16 PM
How do I calculate an average by a certain percentage? cwilson Excel Worksheet Functions 1 September 11th 06 12:33 AM
HOW DO I CALCULATE A RUNNING PERCENTAGE fniguy24095 Excel Discussion (Misc queries) 1 May 4th 05 08:12 PM
calculate percentage JP Excel Worksheet Functions 6 March 2nd 05 02:34 PM
Forumla to calculate a percentage julie regan Excel Discussion (Misc queries) 0 January 20th 05 07:53 PM


All times are GMT +1. The time now is 10:05 PM.

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

About Us

"It's about Microsoft Excel"