A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IF formula



 
 
Thread Tools Display Modes
  #1  
Old February 1st, 2008, 11:38 AM posted to microsoft.public.excel.worksheet.functions
Zak
external usenet poster
 
Posts: 42
Default IF formula

I have the following SUMIF statement but i would like to modify the formula
so it only counts the the negative numbers, i tried if0 but no luck.

=SUMIF(B2:B122,C123,D2122)

the D reference should say somewhere 'if less than 0' - so it only counts
negative numbers.

thanks for your help.
  #2  
Old February 1st, 2008, 11:57 AM posted to microsoft.public.excel.worksheet.functions
Max
external usenet poster
 
Posts: 8,574
Default IF formula

One way:
=SUMPRODUCT((B2:B122=C123)*(D21220)*D2122)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Zak" wrote:
I have the following SUMIF statement but i would like to modify the formula
so it only counts the the negative numbers, i tried if0 but no luck.

=SUMIF(B2:B122,C123,D2122)

the D reference should say somewhere 'if less than 0' - so it only counts
negative numbers.

thanks for your help.

  #3  
Old February 1st, 2008, 12:05 PM posted to microsoft.public.excel.worksheet.functions
Zak
external usenet poster
 
Posts: 42
Default IF formula

THANKS, that worked great but just to understand it for future purposes..
what are the two * doing and why do you make refernce to the D bit twice?

Do you have syntax for this? for eg, sumif syntax is range, criteria and sum
range - what would it be for this? just trying to make sense of it.

thanks alot

"Max" wrote:

One way:
=SUMPRODUCT((B2:B122=C123)*(D21220)*D2122)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Zak" wrote:
I have the following SUMIF statement but i would like to modify the formula
so it only counts the the negative numbers, i tried if0 but no luck.

=SUMIF(B2:B122,C123,D2122)

the D reference should say somewhere 'if less than 0' - so it only counts
negative numbers.

thanks for your help.

  #4  
Old February 1st, 2008, 12:32 PM posted to microsoft.public.excel.worksheet.functions
Zak
external usenet poster
 
Posts: 42
Default IF formula

Hi,

i think there is a problem with the formula, it is working but not picking
up the correct value.

i have emailed you on your yahoo address to ask if its ok that i email you
the sample spreadsheet so you can see the problem.

thanks alot.

"Max" wrote:

One way:
=SUMPRODUCT((B2:B122=C123)*(D21220)*D2122)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Zak" wrote:
I have the following SUMIF statement but i would like to modify the formula
so it only counts the the negative numbers, i tried if0 but no luck.

=SUMIF(B2:B122,C123,D2122)

the D reference should say somewhere 'if less than 0' - so it only counts
negative numbers.

thanks for your help.

  #5  
Old February 1st, 2008, 01:21 PM posted to microsoft.public.excel.worksheet.functions
Max
external usenet poster
 
Posts: 8,574
Default IF formula

Pl do not email

Post a link to your sample* file here.

This way, the ensuing discussions
stays visible to all who may be interested.

You could use this to upload:
http://www.freefilehosting.net/

*desensitized as required
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #6  
Old February 1st, 2008, 01:30 PM posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
external usenet poster
 
Posts: 3,719
Default IF formula

On Fri, 1 Feb 2008 03:38:15 -0800, Zak wrote:

I have the following SUMIF statement but i would like to modify the formula
so it only counts the the negative numbers, i tried if0 but no luck.

=SUMIF(B2:B122,C123,D2122)

the D reference should say somewhere 'if less than 0' - so it only counts
negative numbers.

thanks for your help.



To count negative numbers:

=countif(rng,"0")

Perhaps you want to do something else?



--ron
  #7  
Old February 1st, 2008, 02:02 PM posted to microsoft.public.excel.worksheet.functions
Zak
external usenet poster
 
Posts: 42
Default IF formula

But i need to have the other references in there too..

=SUMIF(B2:B122,C123,D2122)


where would i insert your 'countif' bit in?

If this works then i need not post my sample file but if it doesnt i will.

thanks.

"Ron Rosenfeld" wrote:

On Fri, 1 Feb 2008 03:38:15 -0800, Zak wrote:

I have the following SUMIF statement but i would like to modify the formula
so it only counts the the negative numbers, i tried if0 but no luck.

=SUMIF(B2:B122,C123,D2122)

the D reference should say somewhere 'if less than 0' - so it only counts
negative numbers.

thanks for your help.



To count negative numbers:

=countif(rng,"0")

Perhaps you want to do something else?



--ron

  #8  
Old February 1st, 2008, 02:22 PM posted to microsoft.public.excel.worksheet.functions
Zak
external usenet poster
 
Posts: 42
Default IF formula

Hi, I managed to get it to work so thanks for that.

thanks for all your help.

"Max" wrote:

Pl do not email

Post a link to your sample* file here.

This way, the ensuing discussions
stays visible to all who may be interested.

You could use this to upload:
http://www.freefilehosting.net/

*desensitized as required
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---



  #9  
Old February 1st, 2008, 02:32 PM posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
external usenet poster
 
Posts: 3,719
Default IF formula

On Fri, 1 Feb 2008 06:02:01 -0800, Zak wrote:

But i need to have the other references in there too..

=SUMIF(B2:B122,C123,D2122)


where would i insert your 'countif' bit in?

If this works then i need not post my sample file but if it doesnt i will.

thanks.


We have a language problem.

You asked: "... i would like to modify the formula
so it only COUNTs the negative numbers"

You don't write where these negative numbers are located.

In Excel, COUNT has a specific meaning. It generally adds 1 to a sum for each
value that meets a certain criteria, and there are multiple COUNT functions.
(COUNT; COUNTA; COUNTBLANK; COUNTIF; DCOUNT; DCOUNTA; COUNTIFS(in Excel 2007);
etc.)

If the Excel use of the word COUNT does not describe what you want to do, then
you had best post what you want to do in more detail.

The formula I gave will add 1 for each number in "rng" that meets your stated
criteria of being less than "0".

To COUNT the numbers less than zero in any range, merely substitute that range
for the "rng" token in the formula I gave.

=countif(D2122,"0") will COUNT all the values in D2122 that are less than
zero.

As I wrote in my first post, "perhaps you want to do something else"?

If for example, you wanted to SUM all the values in D2122 that meet multiple
criteria, then you should write that, AND ALSO **ALL** the criteria you wish to
use.

One thought is that you want to SUM (or add up) all of the values in the range
D2:d122 that are less than zero, provided that the value in the same row in the
range B2:B122 matches the value in C123?

If that were the case, then you might try:

=SUMPRODUCT((B2:B122=C123)*(D21220)*D2122)

Perhaps you want to only COUNT those values?

Perhaps something else?

Stating your problem clearly allows those responding to avoid giving useless
answers in an attempt to read your mind, and saves a lot of time.

I often find that stating the problem clearly often enables ME to figure out
the answer without even asking for help.
--ron
  #10  
Old February 1st, 2008, 02:41 PM posted to microsoft.public.excel.worksheet.functions
Zak
external usenet poster
 
Posts: 42
Default IF formula

Thanks for the extensive response, i didnt realise i was being so vague!
thanks for advise and thanks for formula, it works great.

very much appreciated

"Ron Rosenfeld" wrote:

On Fri, 1 Feb 2008 06:02:01 -0800, Zak wrote:

But i need to have the other references in there too..

=SUMIF(B2:B122,C123,D2122)


where would i insert your 'countif' bit in?

If this works then i need not post my sample file but if it doesnt i will.

thanks.


We have a language problem.

You asked: "... i would like to modify the formula
so it only COUNTs the negative numbers"

You don't write where these negative numbers are located.

In Excel, COUNT has a specific meaning. It generally adds 1 to a sum for each
value that meets a certain criteria, and there are multiple COUNT functions.
(COUNT; COUNTA; COUNTBLANK; COUNTIF; DCOUNT; DCOUNTA; COUNTIFS(in Excel 2007);
etc.)

If the Excel use of the word COUNT does not describe what you want to do, then
you had best post what you want to do in more detail.

The formula I gave will add 1 for each number in "rng" that meets your stated
criteria of being less than "0".

To COUNT the numbers less than zero in any range, merely substitute that range
for the "rng" token in the formula I gave.

=countif(D2122,"0") will COUNT all the values in D2122 that are less than
zero.

As I wrote in my first post, "perhaps you want to do something else"?

If for example, you wanted to SUM all the values in D2122 that meet multiple
criteria, then you should write that, AND ALSO **ALL** the criteria you wish to
use.

One thought is that you want to SUM (or add up) all of the values in the range
D2:d122 that are less than zero, provided that the value in the same row in the
range B2:B122 matches the value in C123?

If that were the case, then you might try:

=SUMPRODUCT((B2:B122=C123)*(D21220)*D2122)

Perhaps you want to only COUNT those values?

Perhaps something else?

Stating your problem clearly allows those responding to avoid giving useless
answers in an attempt to read your mind, and saves a lot of time.

I often find that stating the problem clearly often enables ME to figure out
the answer without even asking for help.
--ron

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.