#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default formula

Hi,
Would anyone know what the formula should be for this below
=sum(a1+a2)/abs(a1)
If I want to use a conditional statement
If a1=0 need the result to be 100%,
but if A1 is any number other than 0 I need the formula above to work as it
should.
Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default formula

Try this...

=IF(A1=0,100,SUM(A1+A2)/ABS(A1))

I'm not sure if the 100 should be 100% or 1... it depends on how you are
making the cell show the percentage.

Rick


"Vic Abrahamian" wrote in message
...
Hi,
Would anyone know what the formula should be for this below
=sum(a1+a2)/abs(a1)
If I want to use a conditional statement
If a1=0 need the result to be 100%,
but if A1 is any number other than 0 I need the formula above to work as
it
should.
Thank you


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default formula

Shouldn't there be a If Not statement too? what if A1 changes to a different
number?
Thank you

"Rick Rothstein (MVP - VB)" wrote:

Try this...

=IF(A1=0,100,SUM(A1+A2)/ABS(A1))

I'm not sure if the 100 should be 100% or 1... it depends on how you are
making the cell show the percentage.

Rick


"Vic Abrahamian" wrote in message
...
Hi,
Would anyone know what the formula should be for this below
=sum(a1+a2)/abs(a1)
If I want to use a conditional statement
If a1=0 need the result to be 100%,
but if A1 is any number other than 0 I need the formula above to work as
it
should.
Thank you



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default formula

I'm not sure I'm following your question... the IF function I gave you
handles both the True and the False condition. It will return 100 if A1 = 0,
otherwise (for any other value in A1) it will return whatever
SUM(A1+A2)/ABS(A1) evaluates to. Isn't that what you asked for?

Rick


"Vic Abrahamian" wrote in message
...
Shouldn't there be a If Not statement too? what if A1 changes to a
different
number?
Thank you

"Rick Rothstein (MVP - VB)" wrote:

Try this...

=IF(A1=0,100,SUM(A1+A2)/ABS(A1))

I'm not sure if the 100 should be 100% or 1... it depends on how you are
making the cell show the percentage.

Rick


"Vic Abrahamian" wrote in
message
...
Hi,
Would anyone know what the formula should be for this below
=sum(a1+a2)/abs(a1)
If I want to use a conditional statement
If a1=0 need the result to be 100%,
but if A1 is any number other than 0 I need the formula above to work
as
it
should.
Thank you




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default formula

Hi, I'm sorry.
Here is in an example
A1=0
B1=9600
C1=sum(A1-b1) which equals (-9600)
With the formula =(IF(A1=0,100,SUM(A1+B1)/ABS(A1))), I get 100
If I change the number to 2 I get 4801, is that correct?
If I change the number to -2 I get 4799


"Rick Rothstein (MVP - VB)" wrote:

I'm not sure I'm following your question... the IF function I gave you
handles both the True and the False condition. It will return 100 if A1 = 0,
otherwise (for any other value in A1) it will return whatever
SUM(A1+A2)/ABS(A1) evaluates to. Isn't that what you asked for?

Rick


"Vic Abrahamian" wrote in message
...
Shouldn't there be a If Not statement too? what if A1 changes to a
different
number?
Thank you

"Rick Rothstein (MVP - VB)" wrote:

Try this...

=IF(A1=0,100,SUM(A1+A2)/ABS(A1))

I'm not sure if the 100 should be 100% or 1... it depends on how you are
making the cell show the percentage.

Rick


"Vic Abrahamian" wrote in
message
...
Hi,
Would anyone know what the formula should be for this below
=sum(a1+a2)/abs(a1)
If I want to use a conditional statement
If a1=0 need the result to be 100%,
but if A1 is any number other than 0 I need the formula above to work
as
it
should.
Thank you






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default formula

Well, I don't know if that is correct or not... it is **your** formula (the
SUM divided by the ABS part), not mine. Also, you gave SUM(A1+A2) in your
first post, but you are showing SUM(A1-B1) in your example (I'm more
concerned with the switch from plus to minus than in the cell reference
change), so I'm not sure what formula you really want. Also, I should have
noted in my first response that you do not need the SUM function call at
all...

SUM(A1+B1) is the same as (A1+B1)

and

SUM(A1-B1) is the same as (A1-B1)

Rick


"Vic Abrahamian" wrote in message
...
Hi, I'm sorry.
Here is in an example
A1=0
B1=9600
C1=sum(A1-b1) which equals (-9600)
With the formula =(IF(A1=0,100,SUM(A1+B1)/ABS(A1))), I get 100
If I change the number to 2 I get 4801, is that correct?
If I change the number to -2 I get 4799


"Rick Rothstein (MVP - VB)" wrote:

I'm not sure I'm following your question... the IF function I gave you
handles both the True and the False condition. It will return 100 if A1 =
0,
otherwise (for any other value in A1) it will return whatever
SUM(A1+A2)/ABS(A1) evaluates to. Isn't that what you asked for?

Rick


"Vic Abrahamian" wrote in
message
...
Shouldn't there be a If Not statement too? what if A1 changes to a
different
number?
Thank you

"Rick Rothstein (MVP - VB)" wrote:

Try this...

=IF(A1=0,100,SUM(A1+A2)/ABS(A1))

I'm not sure if the 100 should be 100% or 1... it depends on how you
are
making the cell show the percentage.

Rick


"Vic Abrahamian" wrote in
message
...
Hi,
Would anyone know what the formula should be for this below
=sum(a1+a2)/abs(a1)
If I want to use a conditional statement
If a1=0 need the result to be 100%,
but if A1 is any number other than 0 I need the formula above to
work
as
it
should.
Thank you





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
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula PJ[_3_] Excel Worksheet Functions 2 June 2nd 10 03:45 PM
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


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