Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Sum formula in E5, add in same cell formula for gain/loss?

[Hallelujah! How many times did I wonder how we were going to survive
without MS ngs and no-one, no-one told me I could still access the ngs
through servers _other_ than the now defunct MS one <lol! Ngs via
newsreader are just so much easier, so really glad to be back here!]

I've been having difficulties this morning. First off, I have an
income in E2 of $2,029.12 and in E4 of $1,765.28. When subtracted
with formula in E5 of =SUM(E2-E4), I get $263.84, which numerically is
fine. However, since it's income, this $263.84 actually represents a
loss so it should be showing as a negative.

Then, in E6 formatted as percentage, I figured out that =(E4-E2)/E2
shows the difference in those amounts as a percentage, -13%, which is
perfect.

My question is how do I get output in E5 of this type (in red), which
actually combines both and also correctly shows as negative or
positive income gain/loss:

-$263.8 (-13% income loss/or gain as case may be)

Thanks so much. Really appreciate any help. :oD

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Sum formula in E5, add in same cell formula for gain/loss?


Don't use the Sum function in E5...
Use "=E4-E2" and the custom number format: #,##0.00;[Red]-#,##0.00
'---
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(XL Companion add-in: compares, matches, counts, lists, finds, deletes...)




"StargateFan"
wrote in message
...
[Hallelujah! How many times did I wonder how we were going to survive
without MS ngs and no-one, no-one told me I could still access the ngs
through servers _other_ than the now defunct MS one <lol! Ngs via
newsreader are just so much easier, so really glad to be back here!]

I've been having difficulties this morning. First off, I have an
income in E2 of $2,029.12 and in E4 of $1,765.28. When subtracted
with formula in E5 of =SUM(E2-E4), I get $263.84, which numerically is
fine. However, since it's income, this $263.84 actually represents a
loss so it should be showing as a negative.

Then, in E6 formatted as percentage, I figured out that =(E4-E2)/E2
shows the difference in those amounts as a percentage, -13%, which is
perfect.

My question is how do I get output in E5 of this type (in red), which
actually combines both and also correctly shows as negative or
positive income gain/loss:

-$263.8 (-13% income loss/or gain as case may be)

Thanks so much. Really appreciate any help. :oD



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Sum formula in E5, add in same cell formula for gain/loss?

On Thu, 20 Jan 2011 09:29:24 -0800, "Jim Cone"
wrote:


Don't use the Sum function in E5...
Use "=E4-E2" and the custom number format: #,##0.00;[Red]-#,##0.00
'---
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(XL Companion add-in: compares, matches, counts, lists, finds, deletes...)


OMG, thanks Jim! It looks like I'll have to rid myself of a lifetime
of a bad habit! I always use SUM! Okay, it's out the window from
here on out <lol.

I actually changed it to currency. I went to see what the other ones
were because there seemed to be only brackets with the red. Glad to
see it was so easy to change (didn't think of that). I formatted as
$#,##0.00;[Red]-$#,##0.00 which I then saw turned it into currency
with minus red in the currency style instead of custom style! D'uh!
<lol

Thanks, re the first part of the formula question. That'll work if
the cell _only_ contained the currency. I'm wondering what will
happen when we add the percentage in brackets to the same cell so that
I can keep this spreadsheet nice and tidy. Otherwise, I'll have to
have an extra 4 columns to deal with percentages alone. Nicer to have
it all contained.

But at least I learned to think a different way and get the right
results in the addition. Bah. Stupid linearly-thinking humans,
eh??!! <g


"StargateFan"
wrote in message
.. .
[Hallelujah! How many times did I wonder how we were going to survive
without MS ngs and no-one, no-one told me I could still access the ngs
through servers _other_ than the now defunct MS one <lol! Ngs via
newsreader are just so much easier, so really glad to be back here!]

I've been having difficulties this morning. First off, I have an
income in E2 of $2,029.12 and in E4 of $1,765.28. When subtracted
with formula in E5 of =SUM(E2-E4), I get $263.84, which numerically is
fine. However, since it's income, this $263.84 actually represents a
loss so it should be showing as a negative.

Then, in E6 formatted as percentage, I figured out that =(E4-E2)/E2
shows the difference in those amounts as a percentage, -13%, which is
perfect.

My question is how do I get output in E5 of this type (in red), which
actually combines both and also correctly shows as negative or
positive income gain/loss:

-$263.8 (-13% income loss/or gain as case may be)

Thanks so much. Really appreciate any help. :oD



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Sum formula in E5, add in same cell formula for gain/loss?

On Thu, 20 Jan 2011 12:10:38 -0500, StargateFan
wrote:

[snip]

[snip] ... First off, I have an
income in E2 of $2,029.12 and in E4 of $1,765.28. When subtracted
with formula in E5 of =SUM(E2-E4), I get $263.84, which numerically is
fine. However, since it's income, this $263.84 actually represents a
loss so it should be showing as a negative.

Then, in E6 formatted as percentage, I figured out that =(E4-E2)/E2
shows the difference in those amounts as a percentage, -13%, which is
perfect.

My question is how do I get output in E5 of this type (in red), which
actually combines both and also correctly shows as negative or
positive income gain/loss:

-$263.8 (-13% income loss/or gain as case may be)


[snip]

Just for future reference, after seeing what Jim Cone advised, I
played around with the separate percentage cell to see if I could get
different outputs depending on whether gain or loss and this
approached the right output:

=(E4-E2)/E2
with custom formatting of:
0%;[Red]-0%" income loss"

Unlike when using something similar in currency, it didn't go to black
when a positive number, but the text did disappear with a positive
number.

Anyway, good for adding text to the output. This doesn't deal with
putting both the gain/loss in currency along with gain/loss in
percentage in same cell but good for future reference.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default Sum formula in E5, add in same cell formula for gain/loss?

If you do put the gain/loss in currency in the same cell as the gain/
loss percentage, eg like:

-$263.80 (-13%)

then this combination would be a text value, and your custom
formatting will have no effect on it. So, you need to decide what
would be more important - separate cells with custom formatting or
combined cells all in black.

Hope this helps.

Pete

On Jan 20, 5:46*pm, StargateFan
wrote:
On Thu, 20 Jan 2011 12:10:38 -0500, StargateFan

wrote:

[snip]

[snip] ... First off, I have an
income in E2 of $2,029.12 and in E4 of $1,765.28. *When subtracted
with formula in E5 of =SUM(E2-E4), I get $263.84, which numerically is
fine. *However, since it's income, this $263.84 actually represents a
loss so it should be showing as a negative.


Then, in E6 formatted as percentage, I figured out that =(E4-E2)/E2
shows the difference in those amounts as a percentage, -13%, which is
perfect.


My question is how do I get output in E5 of this type (in red), which
actually combines both and also correctly shows as negative or
positive income gain/loss:


-$263.8 (-13% income loss/or gain as case may be)


[snip]

Just for future reference, after seeing what Jim Cone advised, I
played around with the separate percentage cell to see if I could get
different outputs depending on whether gain or loss and this
approached the right output:

=(E4-E2)/E2
with custom formatting of:
0%;[Red]-0%" income loss"

Unlike when using something similar in currency, it didn't go to black
when a positive number, but the text did disappear with a positive
number.

Anyway, good for adding text to the output. *This doesn't deal with
putting both the gain/loss in currency along with gain/loss in
percentage in same cell but good for future reference.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Sum formula in E5, add in same cell formula for gain/loss?

You could combine 2 seperate cells to show a representation of it though.

For instance: Assumed

A1 = $OldSalaryValue
B1 = $NewSalryValue
C1 = ValueDiff (=$B$1-$A$1)
D1 = %Diff (=($C$1/$A$1)*100 [NumberFormat])

E1 = C1&" ("&D1&"%)"

Which will give you:

-$263.80 (-13%)

Again, the only drawback here is that this is a text representation only of
the 2 combined cells.

HTH
Mick


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Sum formula in E5, add in same cell formula for gain/loss?

After a little more mucking around I have discovered the only negative
consideration in using something like this is that you're kinda restricted
to how it displays.

eg

In actuality the cell would display as thus:

E1 = C1&" ("&D1&"%)"

-263.28 (-13.0026809651475%)

Someone else may be able to weigh in with something like a Right(), Left, or
Trim() to incorporate into it to remove any excess numbers to trim it to
just representing the whole number or at least to 2 decimals.

HTH
Mick



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,856
Default Sum formula in E5, add in same cell formula for gain/loss?

Mick,

you would use TEXT with a format string to control how the digits are
displayed.

Hope this helps.

Pete

On Jan 21, 12:36*pm, "Vacuum Sealed" wrote:
After a little more mucking around I have discovered the only negative
consideration in using something like this is that you're kinda restricted
to how it displays.

eg

In actuality the cell would display as thus:

E1 = C1&" ("&D1&"%)"

-263.28 (-13.0026809651475%)

Someone else may be able to weigh in with something like a Right(), Left, or
Trim() to incorporate into it to remove any excess numbers to trim it to
just representing the whole number or at least to 2 decimals.

HTH
Mick


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
formula for calculating wt gain or loss cumulative in excel Yaka Setting up and Configuration of Excel 4 April 22nd 23 08:13 AM
gain and loss gma Excel Worksheet Functions 1 March 2nd 09 08:43 PM
gain-loss gma Excel Worksheet Functions 5 February 23rd 09 10:07 PM
How can I display a loss or gain (currency) brewster56 Excel Worksheet Functions 5 November 26th 08 07:41 PM
Weight Gain Loss JoeMNY Excel Discussion (Misc queries) 3 December 31st 06 10:32 PM


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

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"