Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
KJ KJ is offline
external usenet poster
 
Posts: 43
Default Sum total using Sumproduct if two criteria met

I'm using a sumproduct function to count how many times a combination of 2
criteria occur at the same time across a range.

Col A contains month and year and is custom formatted as mmm-yy eg Jan-08
Col B contains a numerical value eg £100 .

Im using
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B1000)) which counts how
many occurances of Jan-08 there are with a value of over 0.

I also need to know:

1. how to calculate the total of all the values in Col B when both my
criteria
are met. eg. sum of col B entries when Col A is Jan-08 and Col B has an
entry of any value in it. Any thoughts on how I amend the sumproduct
function to sum rather than count when two criteria are met.

2. Also, by using the 0 in my function, it then doesn't include any 0
entries I might have in Col B. I changed the formula to =0 at the end as
follows
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B100=0))
but it then included the cells that were blank too (I only want them to be
included in my count if I have a numerical value in the cell). Is there a
way of setting the 2nd criteria to be a value or entry of any numerical
value, even zero, perhaps by adding a wildcard*.

Thanks for any help you can offer.

--
KJ
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Sum total using Sumproduct if two criteria met

Hi,

Try this.

=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*isnumber(B1:B100))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"KJ" wrote in message
...
I'm using a sumproduct function to count how many times a combination of 2
criteria occur at the same time across a range.

Col A contains month and year and is custom formatted as mmm-yy eg Jan-08
Col B contains a numerical value eg £100 .

Im using
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B1000)) which counts
how
many occurances of Jan-08 there are with a value of over 0.

I also need to know:

1. how to calculate the total of all the values in Col B when both my
criteria
are met. eg. sum of col B entries when Col A is Jan-08 and Col B has an
entry of any value in it. Any thoughts on how I amend the sumproduct
function to sum rather than count when two criteria are met.

2. Also, by using the 0 in my function, it then doesn't include any 0
entries I might have in Col B. I changed the formula to =0 at the end as
follows
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B100=0))
but it then included the cells that were blank too (I only want them to be
included in my count if I have a numerical value in the cell). Is there a
way of setting the 2nd criteria to be a value or entry of any numerical
value, even zero, perhaps by adding a wildcard*.

Thanks for any help you can offer.

--
KJ


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
KJ KJ is offline
external usenet poster
 
Posts: 43
Default Sum total using Sumproduct if two criteria met

Thanks - that sorts the problem of replacignthe zero to look for any
numerical value.

Any thoughts on the 1st point about calculating the sum total? Thx.
--
KJ


"Ashish Mathur" wrote:

Hi,

Try this.

=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*isnumber(B1:B100))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"KJ" wrote in message
...
I'm using a sumproduct function to count how many times a combination of 2
criteria occur at the same time across a range.

Col A contains month and year and is custom formatted as mmm-yy eg Jan-08
Col B contains a numerical value eg £100 .

Im using
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B1000)) which counts
how
many occurances of Jan-08 there are with a value of over 0.

I also need to know:

1. how to calculate the total of all the values in Col B when both my
criteria
are met. eg. sum of col B entries when Col A is Jan-08 and Col B has an
entry of any value in it. Any thoughts on how I amend the sumproduct
function to sum rather than count when two criteria are met.

2. Also, by using the 0 in my function, it then doesn't include any 0
entries I might have in Col B. I changed the formula to =0 at the end as
follows
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B100=0))
but it then included the cells that were blank too (I only want them to be
included in my count if I have a numerical value in the cell). Is there a
way of setting the 2nd criteria to be a value or entry of any numerical
value, even zero, perhaps by adding a wildcard*.

Thanks for any help you can offer.

--
KJ



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Sum total using Sumproduct if two criteria met

Hi,

Question 1: Sum
=SUMPRODUCT(--(TEXT(A1:A100,"mmm-yy")="Jan-08"),--(B1:B1000),B1:B100)

Question 2: Count =0
=SUMPRODUCT(--(TEXT(A1:A100,"mmm-yy")="Jan-08"),--(B1:B100=0),--ISNUMBER(B1:B100))

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"KJ" wrote:

I'm using a sumproduct function to count how many times a combination of 2
criteria occur at the same time across a range.

Col A contains month and year and is custom formatted as mmm-yy eg Jan-08
Col B contains a numerical value eg £100 .

Im using
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B1000)) which counts how
many occurances of Jan-08 there are with a value of over 0.

I also need to know:

1. how to calculate the total of all the values in Col B when both my
criteria
are met. eg. sum of col B entries when Col A is Jan-08 and Col B has an
entry of any value in it. Any thoughts on how I amend the sumproduct
function to sum rather than count when two criteria are met.

2. Also, by using the 0 in my function, it then doesn't include any 0
entries I might have in Col B. I changed the formula to =0 at the end as
follows
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B100=0))
but it then included the cells that were blank too (I only want them to be
included in my count if I have a numerical value in the cell). Is there a
way of setting the 2nd criteria to be a value or entry of any numerical
value, even zero, perhaps by adding a wildcard*.

Thanks for any help you can offer.

--
KJ

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Sum total using Sumproduct if two criteria met

Hi Ashish,

I think this fails if B1 contains a negative number.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Ashish Mathur" wrote:

Hi,

Try this.

=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*isnumber(B1:B100))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"KJ" wrote in message
...
I'm using a sumproduct function to count how many times a combination of 2
criteria occur at the same time across a range.

Col A contains month and year and is custom formatted as mmm-yy eg Jan-08
Col B contains a numerical value eg £100 .

Im using
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B1000)) which counts
how
many occurances of Jan-08 there are with a value of over 0.

I also need to know:

1. how to calculate the total of all the values in Col B when both my
criteria
are met. eg. sum of col B entries when Col A is Jan-08 and Col B has an
entry of any value in it. Any thoughts on how I amend the sumproduct
function to sum rather than count when two criteria are met.

2. Also, by using the 0 in my function, it then doesn't include any 0
entries I might have in Col B. I changed the formula to =0 at the end as
follows
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B100=0))
but it then included the cells that were blank too (I only want them to be
included in my count if I have a numerical value in the cell). Is there a
way of setting the 2nd criteria to be a value or entry of any numerical
value, even zero, perhaps by adding a wildcard*.

Thanks for any help you can offer.

--
KJ





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Sum total using Sumproduct if two criteria met

Hi,

I wonder why - I am checking for a number.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Shane Devenshire" wrote in
message ...
Hi Ashish,

I think this fails if B1 contains a negative number.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Ashish Mathur" wrote:

Hi,

Try this.

=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*isnumber(B1:B100))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"KJ" wrote in message
...
I'm using a sumproduct function to count how many times a combination
of 2
criteria occur at the same time across a range.

Col A contains month and year and is custom formatted as mmm-yy eg
Jan-08
Col B contains a numerical value eg £100 .

Im using
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B1000)) which counts
how
many occurances of Jan-08 there are with a value of over 0.

I also need to know:

1. how to calculate the total of all the values in Col B when both my
criteria
are met. eg. sum of col B entries when Col A is Jan-08 and Col B has an
entry of any value in it. Any thoughts on how I amend the sumproduct
function to sum rather than count when two criteria are met.

2. Also, by using the 0 in my function, it then doesn't include any 0
entries I might have in Col B. I changed the formula to =0 at the end
as
follows
=SUMPRODUCT((TEXT(A1:A100,"mmm-yy")="Jan-08")*(B1:B100=0))
but it then included the cells that were blank too (I only want them to
be
included in my count if I have a numerical value in the cell). Is
there a
way of setting the 2nd criteria to be a value or entry of any numerical
value, even zero, perhaps by adding a wildcard*.

Thanks for any help you can offer.

--
KJ



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
SUMPRODUCT gives incorrect total jeannie v Excel Worksheet Functions 10 January 20th 08 02:46 AM
Total using 2 columns for criteria Lost in Microbiology Excel Discussion (Misc queries) 3 May 10th 07 03:54 PM
SUMPRODUCT using and INDEX function doesn't total rlutes Excel Worksheet Functions 8 June 5th 05 12:29 AM
Dividing a Total with criteria... Chad Excel Discussion (Misc queries) 5 February 28th 05 03:17 PM
sumproduct to add total amounts for the month Annette Excel Worksheet Functions 6 November 24th 04 03:39 PM


All times are GMT +1. The time now is 01:09 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"