ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF statement help (https://www.excelbanter.com/excel-discussion-misc-queries/227599-if-statement-help.html)

KevinM

IF statement help
 
I am trying to return the following with an IF statement but I can not
get it to work. I don't know if the IF statement is the correct
formual to use so any help would be appricated.

I am trying to say the statring month is the default value (ie $400).
If a month has a negative amout greater than the sum of the previous
months it only returns a value of the negative of the sum (ie $400+
$400= $800, -$2400 for Mar, so really it is -$800). If it is greater
than the first month it only counts the default value and not the
higher value (ie $600 is really $400). If it doesn't meet any of
those critera than it is just the value for that month.


Jan Feb Mar Jan Feb Mar Total
$400 $400 -$2400 $400 $400 -$800 $0
$400 $400 -$200 $400 $400 -$200 $600
$400 $400 $600 $400 $400 $400 $1200

Luke M

IF statement help
 
I believe the new January value will always equal the old January value, so
that should be a simple
=A2
For the other months starting in Feb:
=IF(AND(B2<0,ABS(B2)SUM($A$2:A2)),-SUM($A$2:A2),IF(B2$A$2,$A$2,B2))
And then copy across.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"KevinM" wrote:

I am trying to return the following with an IF statement but I can not
get it to work. I don't know if the IF statement is the correct
formual to use so any help would be appricated.

I am trying to say the statring month is the default value (ie $400).
If a month has a negative amout greater than the sum of the previous
months it only returns a value of the negative of the sum (ie $400+
$400= $800, -$2400 for Mar, so really it is -$800). If it is greater
than the first month it only counts the default value and not the
higher value (ie $600 is really $400). If it doesn't meet any of
those critera than it is just the value for that month.


Jan Feb Mar Jan Feb Mar Total
$400 $400 -$2400 $400 $400 -$800 $0
$400 $400 -$200 $400 $400 -$200 $600
$400 $400 $600 $400 $400 $400 $1200



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com