#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Difference

I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF IF
command.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Difference

Hi Steve

Why not just =A1-B1 ?

--
Regards

Roger Govier


"Stevep-4" wrote in message
...
I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM
of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A
is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF
IF
command.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Difference

Maybe a slight tweak

=ABS(A1-B1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Roger Govier" wrote in message
...
Hi Steve

Why not just =A1-B1 ?

--
Regards

Roger Govier


"Stevep-4" wrote in message
...
I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM
of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A
is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF
IF
command.





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Difference

Thanks Bob
Hadn't noticed the OP wanted 245 and not -245 as his result.

--
Regards

Roger Govier


"Bob Phillips" wrote in message
...
Maybe a slight tweak

=ABS(A1-B1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Roger Govier" wrote in message
...
Hi Steve

Why not just =A1-B1 ?

--
Regards

Roger Govier


"Stevep-4" wrote in message
...
I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a
SUM
of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A
is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF
IF
IF
command.







  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Difference

=B1-A1 gives 245 with your example numbers, Excel knows elementary maths, why
didn't you try it?

Regards,
Stefi

€˛Stevep-4€¯ ezt Ć*rta:

I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF IF
command.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 54
Default Difference

set up cell 'C' with =if(AB,A,B) and set up cell 'D' with =if(A<B,A,B)
then in cell 'E' have =C-D, which is the difference between the values.

ensuring that you have the larger value in cell 'C' will stop you from
achieving a negative value for the difference.

"Stevep-4" wrote:

I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF IF
command.

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Difference

Thanks Hot dogs, that works. The other suggestions do not work due to the
fact that either cells A or B can be negative.
Thus
If A= -45 and B= 45. Difference is 90
If A= 45 and B= -45. Difference is 90.


Is there a simpler method though, that can be done in one cell? for example
=DIFF(A:B)


"hot dogs" wrote:

set up cell 'C' with =if(AB,A,B) and set up cell 'D' with =if(A<B,A,B)
then in cell 'E' have =C-D, which is the difference between the values.

ensuring that you have the larger value in cell 'C' will stop you from
achieving a negative value for the difference.

"Stevep-4" wrote:

I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF IF
command.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Difference

See my amendment to Roger's response.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Stevep-4" wrote in message
...
Thanks Hot dogs, that works. The other suggestions do not work due to the
fact that either cells A or B can be negative.
Thus
If A= -45 and B= 45. Difference is 90
If A= 45 and B= -45. Difference is 90.


Is there a simpler method though, that can be done in one cell? for

example
=DIFF(A:B)


"hot dogs" wrote:

set up cell 'C' with =if(AB,A,B) and set up cell 'D' with =if(A<B,A,B)
then in cell 'E' have =C-D, which is the difference between the values.

ensuring that you have the larger value in cell 'C' will stop you from
achieving a negative value for the difference.

"Stevep-4" wrote:

I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM

of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A

is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF

IF
command.



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 618
Default Difference

What's wrong with =ABS(A1-B1)? (or =ABS(B1-A1)?)
Doesn't that give 90 for each of your examples?
--
David Biddulph

"Stevep-4" wrote in message
...
Thanks Hot dogs, that works. The other suggestions do not work due to the
fact that either cells A or B can be negative.
Thus
If A= -45 and B= 45. Difference is 90
If A= 45 and B= -45. Difference is 90.


Is there a simpler method though, that can be done in one cell? for
example
=DIFF(A:B)


"hot dogs" wrote:

set up cell 'C' with =if(AB,A,B) and set up cell 'D' with =if(A<B,A,B)
then in cell 'E' have =C-D, which is the difference between the values.

ensuring that you have the larger value in cell 'C' will stop you from
achieving a negative value for the difference.


"Stevep-4" wrote:

I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM
of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A
is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF IF
command.



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 54
Default Difference

to produce the result using one cell use
=if((A-B)<=0,((A-B)+(2*(0-(A-B)))),(A-B))

"Stevep-4" wrote:

I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM of the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF IF
command.



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 618
Default Difference

"Stevep-4" wrote in message
...
I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM of
the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF IF
command.


=B1-A1
or
=ABS(B1-A1)
depending on what you want.
--
David Biddulph


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

ABS(B1-A1) works perfectly whether A or B (or both) are negative.

Thanks.




"David Biddulph" wrote:

"Stevep-4" wrote in message
...
I am sure there is a very simple answer to this.

I need to calulate the difference between 2 cells (each cell is a SUM of
the
information of other cells).

the content of each of these cells could be +ve or -ve. Thus, if A is -45
and B is 200, then the difference is 245.

Is there a simple was of doing this, rather than a long winded IF IF IF
command.


=B1-A1
or
=ABS(B1-A1)
depending on what you want.
--
David Biddulph



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
Averaging Time Difference vldavis809 Excel Discussion (Misc queries) 1 July 8th 06 09:42 AM
Formula to find the working days difference between to dates? Mudgeman Excel Discussion (Misc queries) 2 May 15th 06 04:26 AM
Difference between two months leitek.com Excel Worksheet Functions 5 March 13th 06 09:10 PM
Percentage difference calc that knows the largest figure Mighty Magpie Excel Discussion (Misc queries) 3 November 10th 05 06:45 PM
charting a difference of 2 columns' w/o adding a difference column Wab Charts and Charting in Excel 4 July 27th 05 02:37 AM


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