Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

I would like to add an item in a formula only if it is a negative number.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

Assume the number is in A1 and the number to which you're adding it is in B1.
In C1: =IF(A1<0,A1+B1,"")

where the set of double quotation double marks returns nothing.

Dave
--
Brevity is the soul of wit.


"tcazabon" wrote:

I would like to add an item in a formula only if it is a negative number.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

=SUMIF(A1:A5,"<0")

Biff

"tcazabon" wrote in message
...
I would like to add an item in a formula only if it is a negative number.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 605
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

I don't understand why "" and not 0.

So, C1 can be text (null is considered text) or numeric depending on the value of A1?

Is there a way that we can insert 0 to get the field consistent (i.e. numeric) but format it in such a way that 0 won't show?

Just wondering ......

Epinn

"Dave F" wrote in message ...
Assume the number is in A1 and the number to which you're adding it is in B1.
In C1: =IF(A1<0,A1+B1,"")

where the set of double quotation double marks returns nothing.

Dave
--
Brevity is the soul of wit.


"tcazabon" wrote:

I would like to add an item in a formula only if it is a negative number.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

If you wanted to return 0 instead of nothing, and not have 0 show, then I
suppose you could apply conditional formatting such that the font color is
the same as the background color if the cell value is zero.

I'm still unclear, though, why you would want 0 to be returned instead of
nothing? Does zero have an advantage that nothing does not have?
--
Brevity is the soul of wit.


"Epinn" wrote:

I don't understand why "" and not 0.

So, C1 can be text (null is considered text) or numeric depending on the value of A1?

Is there a way that we can insert 0 to get the field consistent (i.e. numeric) but format it in such a way that 0 won't show?

Just wondering ......

Epinn

"Dave F" wrote in message ...
Assume the number is in A1 and the number to which you're adding it is in B1.
In C1: =IF(A1<0,A1+B1,"")

where the set of double quotation double marks returns nothing.

Dave
--
Brevity is the soul of wit.


"tcazabon" wrote:

I would like to add an item in a formula only if it is a negative number.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 605
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

I'm still unclear, though, why you would want 0 to be returned instead of
nothing? <<

As I mentioned in my first post, I want the cell/column to be consistent i.e. numeric and not sometimes text and sometimes numeric depending on the value in column A.

I may be overly concerned, but I have a reason for that. May be you can help me get rid of my concern.

Does zero have an advantage that nothing does not have? <<


Yes. If I use zero, the following formulae won't fail. If I use "" and "" is returned the following formulae will fail.

=SUMPRODUCT((E1:E2="yes")*(C1:C2))

=SUMPRODUCT(--(E1:E2="yes"),--(C1:C2))

Of course, you can argue that I can fix my SUMPRODUCT formulae to check for "".

But I agree with you that "Brevity is the soul of wit" so I prefer to use 0 instead of checking for "" in the SUMPRODUCT formulae.

If it is not a problem to show 0, I'll definitely go with 0.

I am open to suggestions.

Epinn










"Dave F" wrote in message ...
If you wanted to return 0 instead of nothing, and not have 0 show, then I
suppose you could apply conditional formatting such that the font color is
the same as the background color if the cell value is zero.

I'm still unclear, though, why you would want 0 to be returned instead of
nothing? Does zero have an advantage that nothing does not have?
--
Brevity is the soul of wit.


"Epinn" wrote:

I don't understand why "" and not 0.

So, C1 can be text (null is considered text) or numeric depending on the value of A1?

Is there a way that we can insert 0 to get the field consistent (i.e. numeric) but format it in such a way that 0 won't show?

Just wondering ......

Epinn

"Dave F" wrote in message ...
Assume the number is in A1 and the number to which you're adding it is in B1.
In C1: =IF(A1<0,A1+B1,"")

where the set of double quotation double marks returns nothing.

Dave
--
Brevity is the soul of wit.


"tcazabon" wrote:

I would like to add an item in a formula only if it is a negative number.




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

Well, then I would have the formula return 0 and use the conditional
formatting suggestion. Then you can run your SUMPRODUCT with 0.

Dave
--
Brevity is the soul of wit.


"Epinn" wrote:

I'm still unclear, though, why you would want 0 to be returned instead of

nothing? <<

As I mentioned in my first post, I want the cell/column to be consistent i.e. numeric and not sometimes text and sometimes numeric depending on the value in column A.

I may be overly concerned, but I have a reason for that. May be you can help me get rid of my concern.

Does zero have an advantage that nothing does not have? <<


Yes. If I use zero, the following formulae won't fail. If I use "" and "" is returned the following formulae will fail.

=SUMPRODUCT((E1:E2="yes")*(C1:C2))

=SUMPRODUCT(--(E1:E2="yes"),--(C1:C2))

Of course, you can argue that I can fix my SUMPRODUCT formulae to check for "".

But I agree with you that "Brevity is the soul of wit" so I prefer to use 0 instead of checking for "" in the SUMPRODUCT formulae.

If it is not a problem to show 0, I'll definitely go with 0.

I am open to suggestions.

Epinn










"Dave F" wrote in message ...
If you wanted to return 0 instead of nothing, and not have 0 show, then I
suppose you could apply conditional formatting such that the font color is
the same as the background color if the cell value is zero.

I'm still unclear, though, why you would want 0 to be returned instead of
nothing? Does zero have an advantage that nothing does not have?
--
Brevity is the soul of wit.


"Epinn" wrote:

I don't understand why "" and not 0.

So, C1 can be text (null is considered text) or numeric depending on the value of A1?

Is there a way that we can insert 0 to get the field consistent (i.e. numeric) but format it in such a way that 0 won't show?

Just wondering ......

Epinn

"Dave F" wrote in message ...
Assume the number is in A1 and the number to which you're adding it is in B1.
In C1: =IF(A1<0,A1+B1,"")

where the set of double quotation double marks returns nothing.

Dave
--
Brevity is the soul of wit.


"tcazabon" wrote:

I would like to add an item in a formula only if it is a negative number.





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

Epinn

But if you used
=SUMPRODUCT(--(E1:E2="yes"),C1:C2)
then it will work whether there are nulls or zero's

--
Regards

Roger Govier


"Epinn" wrote in message
...
I'm still unclear, though, why you would want 0 to be returned
instead of

nothing? <<

As I mentioned in my first post, I want the cell/column to be consistent
i.e. numeric and not sometimes text and sometimes numeric depending on
the value in column A.

I may be overly concerned, but I have a reason for that. May be you can
help me get rid of my concern.

Does zero have an advantage that nothing does not have? <<


Yes. If I use zero, the following formulae won't fail. If I use "" and
"" is returned the following formulae will fail.

=SUMPRODUCT((E1:E2="yes")*(C1:C2))

=SUMPRODUCT(--(E1:E2="yes"),--(C1:C2))

Of course, you can argue that I can fix my SUMPRODUCT formulae to check
for "".

But I agree with you that "Brevity is the soul of wit" so I prefer to
use 0 instead of checking for "" in the SUMPRODUCT formulae.

If it is not a problem to show 0, I'll definitely go with 0.

I am open to suggestions.

Epinn










"Dave F" wrote in message
...
If you wanted to return 0 instead of nothing, and not have 0 show, then
I
suppose you could apply conditional formatting such that the font color
is
the same as the background color if the cell value is zero.

I'm still unclear, though, why you would want 0 to be returned instead
of
nothing? Does zero have an advantage that nothing does not have?
--
Brevity is the soul of wit.


"Epinn" wrote:

I don't understand why "" and not 0.

So, C1 can be text (null is considered text) or numeric depending on
the value of A1?

Is there a way that we can insert 0 to get the field consistent (i.e.
numeric) but format it in such a way that 0 won't show?

Just wondering ......

Epinn

"Dave F" wrote in message
...
Assume the number is in A1 and the number to which you're adding it is
in B1.
In C1: =IF(A1<0,A1+B1,"")

where the set of double quotation double marks returns nothing.

Dave
--
Brevity is the soul of wit.


"tcazabon" wrote:

I would like to add an item in a formula only if it is a negative
number.





  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 605
Default ADD AN ITEM IN A FORMULA ONLY IF IT IS A NEGATIVE

Roger,

Thank you so much. I had initiated a thread before I dropped by here. But, I have had no response and have been waiting for an answer. Your suggestion is what I have been waiting for. But I may still have a question on why yours work and the other two won't.

If you care to respond, this is my thread.

http://groups.google.ca/group/micros...49e47a 1ee3a5

http://tinyurl.com/y6m26b

So, I guess it is okay to use null, if we are not concerned about being consistent, right?

Okay, everyone is happy now.

Thanks.

Epinn

"Roger Govier" wrote in message ...
Epinn

But if you used
=SUMPRODUCT(--(E1:E2="yes"),C1:C2)
then it will work whether there are nulls or zero's

--
Regards

Roger Govier


"Epinn" wrote in message
...
I'm still unclear, though, why you would want 0 to be returned
instead of

nothing? <<

As I mentioned in my first post, I want the cell/column to be consistent
i.e. numeric and not sometimes text and sometimes numeric depending on
the value in column A.

I may be overly concerned, but I have a reason for that. May be you can
help me get rid of my concern.

Does zero have an advantage that nothing does not have? <<


Yes. If I use zero, the following formulae won't fail. If I use "" and
"" is returned the following formulae will fail.

=SUMPRODUCT((E1:E2="yes")*(C1:C2))

=SUMPRODUCT(--(E1:E2="yes"),--(C1:C2))

Of course, you can argue that I can fix my SUMPRODUCT formulae to check
for "".

But I agree with you that "Brevity is the soul of wit" so I prefer to
use 0 instead of checking for "" in the SUMPRODUCT formulae.

If it is not a problem to show 0, I'll definitely go with 0.

I am open to suggestions.

Epinn










"Dave F" wrote in message
...
If you wanted to return 0 instead of nothing, and not have 0 show, then
I
suppose you could apply conditional formatting such that the font color
is
the same as the background color if the cell value is zero.

I'm still unclear, though, why you would want 0 to be returned instead
of
nothing? Does zero have an advantage that nothing does not have?
--
Brevity is the soul of wit.


"Epinn" wrote:

I don't understand why "" and not 0.

So, C1 can be text (null is considered text) or numeric depending on
the value of A1?

Is there a way that we can insert 0 to get the field consistent (i.e.
numeric) but format it in such a way that 0 won't show?

Just wondering ......

Epinn

"Dave F" wrote in message
...
Assume the number is in A1 and the number to which you're adding it is
in B1.
In C1: =IF(A1<0,A1+B1,"")

where the set of double quotation double marks returns nothing.

Dave
--
Brevity is the soul of wit.


"tcazabon" wrote:

I would like to add an item in a formula only if it is a negative
number.






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
If the result of a formula is negative make equal to zero Nrippe New Users to Excel 5 June 12th 06 10:39 PM
Negative numbers in easy formula getting me down... jennieoh Excel Discussion (Misc queries) 3 June 9th 06 05:04 PM
Ignore a cell used in a formula if it contains a negative value Donald Thomas Excel Discussion (Misc queries) 2 February 19th 06 02:18 AM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM


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

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"