ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Test for a negative # (https://www.excelbanter.com/excel-worksheet-functions/51787-test-negative.html)

Alex

Test for a negative #
 
I need to test a cell value to determine if is negative or positive. If
negative, the value gets subtracted from partA and added to partB. If
positive, it gets added to partA and subtracted from partB. I've seen a few
posts close to this problem, but not close enough to help me. I'm stumped,
my "if" statements keep running me in circles. I've got plenty of room
offscreen to do this evaluation, but ... .

Thanks!


Roland

Test for a negative #
 
I'm going to take a wild guess that the source of your problem is arithmetic
with negative numbers, that when you say you want to subtract the negative
number, what you really mean is subtract the absolute value of the negative
number, and when you say you want to add the value, you mean you want to add
the absolute value of the test value.


"Alex" wrote:

I need to test a cell value to determine if is negative or positive. If
negative, the value gets subtracted from partA and added to partB. If
positive, it gets added to partA and subtracted from partB. I've seen a few
posts close to this problem, but not close enough to help me. I'm stumped,
my "if" statements keep running me in circles. I've got plenty of room
offscreen to do this evaluation, but ... .

Thanks!


Richard Buttrey

Test for a negative #
 
On Sat, 22 Oct 2005 15:25:02 -0700, "Alex"
wrote:

I need to test a cell value to determine if is negative or positive. If
negative, the value gets subtracted from partA and added to partB. If
positive, it gets added to partA and subtracted from partB. I've seen a few
posts close to this problem, but not close enough to help me. I'm stumped,
my "if" statements keep running me in circles. I've got plenty of room
offscreen to do this evaluation, but ... .

Thanks!



If(yourcell<0,partB+partA-yourcell,PartB-partA+yourcell)

HTH, if not a specific example would be useful.

Rgds

__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

Alex

Test for a negative #
 
Yes the problem is arithmetic, but no I am not looking for the absolute
value. It is a formula with several parts, and the input value is to be
subtracted & added to 2 different parts as I described below. That's what
has me stumped. I could change the input requirement to 2 values, one a + or
-, and the other the value. But I was trying to do it with 1 input value.

"Roland" wrote:

I'm going to take a wild guess that the source of your problem is arithmetic
with negative numbers, that when you say you want to subtract the negative
number, what you really mean is subtract the absolute value of the negative
number, and when you say you want to add the value, you mean you want to add
the absolute value of the test value.


"Alex" wrote:

I need to test a cell value to determine if is negative or positive. If
negative, the value gets subtracted from partA and added to partB. If
positive, it gets added to partA and subtracted from partB. I've seen a few
posts close to this problem, but not close enough to help me. I'm stumped,
my "if" statements keep running me in circles. I've got plenty of room
offscreen to do this evaluation, but ... .

Thanks!



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

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