Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Sumif for countif?

Hi all,

Got a bit of a problem, I want to use the sumif comand as a countif i.e. I
have data with years 1990 to 2003 in column A and in column B I have various
numbers.

I want with a comand similar to sumif to show show me how many of the 1990
years make up the 1990 total.

Would appreciate your help.

Pantelis


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Sumif for countif?

Pantelis, try this =SUMPRODUCT((YEAR(A1:A100)=1990)*(B1:B100))

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
"pantelis" wrote in message
...
Hi all,

Got a bit of a problem, I want to use the sumif comand as a countif i.e. I
have data with years 1990 to 2003 in column A and in column B I have

various
numbers.

I want with a comand similar to sumif to show show me how many of the 1990
years make up the 1990 total.

Would appreciate your help.

Pantelis




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Sumif for countif?

Paul thanks for the response but will not work

1990 9932
1990 6918
1990 9125
1990 9270
1990 6239
1991 9156
1991 6161
1991 4089
1992 2021
1992 876
1992 2637
1992 5312
1992 8501


for example for these figures it should have shown me count=5 for 1990, 3
for 1991 etc.

I most probably have to define a funciton as code as I could have three or
four columns and the funtion should come back and show me the cound for 1990
in column 1, 2 & 3 say.

Would appreciate any other recommendations
Pantelis



"Paul B" wrote in message
...
Pantelis, try this =SUMPRODUCT((YEAR(A1:A100)=1990)*(B1:B100))

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
"pantelis" wrote in message
...
Hi all,

Got a bit of a problem, I want to use the sumif comand as a countif i.e.

I
have data with years 1990 to 2003 in column A and in column B I have

various
numbers.

I want with a comand similar to sumif to show show me how many of the

1990
years make up the 1990 total.

Would appreciate your help.

Pantelis






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Sumif for countif?

Pantelis,

Why don't you use a countif

=COUNTIF(A:A,1990)
=COUNTIF(A1:A50,1990)

Dan E

"pantelis" wrote in message ...
Paul thanks for the response but will not work

1990 9932
1990 6918
1990 9125
1990 9270
1990 6239
1991 9156
1991 6161
1991 4089
1992 2021
1992 876
1992 2637
1992 5312
1992 8501


for example for these figures it should have shown me count=5 for 1990, 3
for 1991 etc.

I most probably have to define a funciton as code as I could have three or
four columns and the funtion should come back and show me the cound for 1990
in column 1, 2 & 3 say.

Would appreciate any other recommendations
Pantelis



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Sumif for countif?

Not sure if I'm missing something, but COUNTIF should work.

=COUNTIF(A:A,"1990") gave me 5

If you want the sum for 1990 use:

=SUMIF(A:A,1990,B:B) which gave me 41,484

Those aren't dates formated to look like years are they? Example:
real value is 1/1/1990 but shows up as "1990" due to formatting. If
so you need to change the formula to look for the whole date not just
the year.

HTH,
Steve Hieb


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Sumif for countif?

Pantelis, I thought you had dates like 1-1-1990 in the column, if you just
have the year use one of the countif formulas that Dan gave you
--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
"Paul B" wrote in message
...
Pantelis, try this =SUMPRODUCT((YEAR(A1:A100)=1990)*(B1:B100))

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
"pantelis" wrote in message
...
Hi all,

Got a bit of a problem, I want to use the sumif comand as a countif i.e.

I
have data with years 1990 to 2003 in column A and in column B I have

various
numbers.

I want with a comand similar to sumif to show show me how many of the

1990
years make up the 1990 total.

Would appreciate your help.

Pantelis






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
Sumif And Countif roter789 Excel Worksheet Functions 7 August 21st 09 12:00 AM
Sumif / Countif Blue Excel Worksheet Functions 3 May 15th 09 03:50 PM
COUNTIF?? SUMIF?? Vegs Excel Discussion (Misc queries) 1 December 19th 05 03:52 PM
COUNTIF or SUMIF or ?? croakingtoad Excel Worksheet Functions 2 November 28th 05 03:05 PM
Countif and sumif Visual Excel Discussion (Misc queries) 19 August 10th 05 05:59 PM


All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"