Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jeff
 
Posts: n/a
Default How can I use COUNTIF to sum for two conditions?

I understand i have to use an array formula, but I don't know how!

I have an array listing dates when products arrived from diffferent
countries. I want to produce a chart which shows the number of arrivals for
each month from each country. COUNTIF will produce a total of arrivals for
each month, or a total from each country (ie for one condition) - but how
about for two conditions - this country in this month?
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=SUMPRODUCT(--(TEXT(A1:A100,"mmm")="Jan"),--(B1:B100="Mexico"))

as an example

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jeff" wrote in message
...
I understand i have to use an array formula, but I don't know how!

I have an array listing dates when products arrived from diffferent
countries. I want to produce a chart which shows the number of arrivals

for
each month from each country. COUNTIF will produce a total of arrivals

for
each month, or a total from each country (ie for one condition) - but how
about for two conditions - this country in this month?



  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

If you mean a particu;ar month that you select (assume december 2004)

=SUMPRODUCT(--(MONTH(A2:A100)=12),--(YEAR(A2:A100)=2004),--(B2:B100="this_country"))

or if you mean the present month according to your computers clock

=SUMPRODUCT(--(MONTH(A2:A100)=MONTH(TODAY())),--(YEAR(A2:A100)=YEAR(TODAY())),--(B2:B100="this_country"))


Regards,

Peo Sjoblom

"Jeff" wrote:

I understand i have to use an array formula, but I don't know how!

I have an array listing dates when products arrived from diffferent
countries. I want to produce a chart which shows the number of arrivals for
each month from each country. COUNTIF will produce a total of arrivals for
each month, or a total from each country (ie for one condition) - but how
about for two conditions - this country in this month?

  #4   Report Post  
Jeff
 
Posts: n/a
Default

Thanks Bob

Trouble is the data are extracted from a data base and one record represents
an item - includes date received and country of origin. List is in the order
of 3000 records, and i want a summary chart with dates (all 1st of month in
'Jan-03' format) down left side with list of countries (as column header)
across top. the number in each cell shoul equal the number of items received
from that country in that month. Summary should change if country name is
changed.

Jeff

"Bob Phillips" wrote:

=SUMPRODUCT(--(TEXT(A1:A100,"mmm")="Jan"),--(B1:B100="Mexico"))

as an example

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jeff" wrote in message
...
I understand i have to use an array formula, but I don't know how!

I have an array listing dates when products arrived from diffferent
countries. I want to produce a chart which shows the number of arrivals

for
each month from each country. COUNTIF will produce a total of arrivals

for
each month, or a total from each country (ie for one condition) - but how
about for two conditions - this country in this month?




  #5   Report Post  
jeff
 
Posts: n/a
Default

thanks Peo - can you see my reply to Bob above?

"Peo Sjoblom" wrote:

If you mean a particu;ar month that you select (assume december 2004)

=SUMPRODUCT(--(MONTH(A2:A100)=12),--(YEAR(A2:A100)=2004),--(B2:B100="this_country"))

or if you mean the present month according to your computers clock

=SUMPRODUCT(--(MONTH(A2:A100)=MONTH(TODAY())),--(YEAR(A2:A100)=YEAR(TODAY())),--(B2:B100="this_country"))


Regards,

Peo Sjoblom

"Jeff" wrote:

I understand i have to use an array formula, but I don't know how!

I have an array listing dates when products arrived from diffferent
countries. I want to produce a chart which shows the number of arrivals for
each month from each country. COUNTIF will produce a total of arrivals for
each month, or a total from each country (ie for one condition) - but how
about for two conditions - this country in this month?

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
COUNTIF using multiple conditions? Muse of Fire New Users to Excel 3 December 29th 04 08:49 PM
countif statement Russell Hampton Excel Worksheet Functions 6 December 18th 04 07:39 PM
setting two conditions for countif Danny J Excel Worksheet Functions 5 December 6th 04 11:49 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM
countif, again Liz G Excel Worksheet Functions 2 November 1st 04 11:20 PM


All times are GMT +1. The time now is 07:34 AM.

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"