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  

How to calculate text according to multiple months?



 
 
Thread Tools Display Modes
  #1  
Old March 18th, 2010, 04:18 PM posted to microsoft.public.excel.worksheet.functions
Joona
external usenet poster
 
Posts: 3
Default How to calculate text according to multiple months?

Hello!

I', having a slight problem with my Excel-worksheet. I have a sheet with
data, like this:

A B
1.1.2010 X
2.2.2010 X
3.3.2010
4.4.2010 X


(A: DDMMYYYY)
How do I get Excel to count all the X:s in the first three months? I have
another sheet to gather this data in which I'm putting the formula.

  #2  
Old March 18th, 2010, 04:25 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default How to calculate text according to multiple months?

One way...

Assumes no empty cells in the data range.

=SUMPRODUCT(--(MONTH(A1:A20)=3),--(B1:B20="x"))

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Hello!

I', having a slight problem with my Excel-worksheet. I have a sheet with
data, like this:

A B
1.1.2010 X
2.2.2010 X
3.3.2010
4.4.2010 X


(A: DDMMYYYY)
How do I get Excel to count all the X:s in the first three months? I have
another sheet to gather this data in which I'm putting the formula.



  #3  
Old March 18th, 2010, 05:13 PM posted to microsoft.public.excel.worksheet.functions
Joona
external usenet poster
 
Posts: 3
Default How to calculate text according to multiple months?

Well, I have empty cells, and the formula doesn't work.. The outcome of the
formula is 6, should be 3 (in my worksheet, not in the example, in my sheet
there are three hits, marked as "X" in the first three months.)

-Joona-

"T. Valko" wrote:

One way...

Assumes no empty cells in the data range.

=SUMPRODUCT(--(MONTH(A1:A20)=3),--(B1:B20="x"))

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Hello!

I', having a slight problem with my Excel-worksheet. I have a sheet with
data, like this:

A B
1.1.2010 X
2.2.2010 X
3.3.2010
4.4.2010 X


(A: DDMMYYYY)
How do I get Excel to count all the X:s in the first three months? I have
another sheet to gather this data in which I'm putting the formula.



.

  #4  
Old March 18th, 2010, 05:25 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default How to calculate text according to multiple months?

Assumes no empty cells in the data range.

There's is a typo in that. What I meant to say was:

Assumes no empty cells in the DATE range.

To account for that:

=SUMPRODUCT(--(ISNUMBER(A1:A20)),--(MONTH(A1:A20)=3),--(B1:B20="x"))

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Well, I have empty cells, and the formula doesn't work.. The outcome of
the
formula is 6, should be 3 (in my worksheet, not in the example, in my
sheet
there are three hits, marked as "X" in the first three months.)

-Joona-

"T. Valko" wrote:

One way...

Assumes no empty cells in the data range.

=SUMPRODUCT(--(MONTH(A1:A20)=3),--(B1:B20="x"))

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Hello!

I', having a slight problem with my Excel-worksheet. I have a sheet
with
data, like this:

A B
1.1.2010 X
2.2.2010 X
3.3.2010
4.4.2010 X


(A: DDMMYYYY)
How do I get Excel to count all the X:s in the first three months? I
have
another sheet to gather this data in which I'm putting the formula.



.



  #5  
Old March 18th, 2010, 06:01 PM posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
external usenet poster
 
Posts: 3,719
Default How to calculate text according to multiple months?

On Thu, 18 Mar 2010 09:18:01 -0700, Joona
wrote:

Hello!

I', having a slight problem with my Excel-worksheet. I have a sheet with
data, like this:

A B
1.1.2010 X
2.2.2010 X
3.3.2010
4.4.2010 X


(A: DDMMYYYY)
How do I get Excel to count all the X:s in the first three months? I have
another sheet to gather this data in which I'm putting the formula.


=SUMPRODUCT(--(rng=Start),--(rng=End),--(OFFSET(rng,0,1)="X"))

rng = the range of dates, e.g. A1:A100
Start = first date to be counted, or a cell reference containing that date
End = last date to be counted, or a cell reference countaining that date

If you have Excel 2007 or later, you could also use:

=COUNTIFS(rng,"="&Start,rng,"="& End,OFFSET(rng,0,1),"X")

--ron
  #6  
Old March 21st, 2010, 11:14 AM posted to microsoft.public.excel.worksheet.functions
Joona
external usenet poster
 
Posts: 3
Default How to calculate text according to multiple months?

Thank you very much, that formula did the trick! just had to think for a
while how to translate that in to the finnish version of Excel... for
istance, commas (,) don't work in my version of finnish excel, I had to
replace them with ;'s to get it working. =)


"T. Valko" wrote:

Assumes no empty cells in the data range.


There's is a typo in that. What I meant to say was:

Assumes no empty cells in the DATE range.

To account for that:

=SUMPRODUCT(--(ISNUMBER(A1:A20)),--(MONTH(A1:A20)=3),--(B1:B20="x"))

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Well, I have empty cells, and the formula doesn't work.. The outcome of
the
formula is 6, should be 3 (in my worksheet, not in the example, in my
sheet
there are three hits, marked as "X" in the first three months.)

-Joona-

"T. Valko" wrote:

One way...

Assumes no empty cells in the data range.

=SUMPRODUCT(--(MONTH(A1:A20)=3),--(B1:B20="x"))

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Hello!

I', having a slight problem with my Excel-worksheet. I have a sheet
with
data, like this:

A B
1.1.2010 X
2.2.2010 X
3.3.2010
4.4.2010 X


(A: DDMMYYYY)
How do I get Excel to count all the X:s in the first three months? I
have
another sheet to gather this data in which I'm putting the formula.



.



.

  #7  
Old March 22nd, 2010, 01:35 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default How to calculate text according to multiple months?

Good deal. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Thank you very much, that formula did the trick! just had to think for a
while how to translate that in to the finnish version of Excel... for
istance, commas (,) don't work in my version of finnish excel, I had to
replace them with ;'s to get it working. =)


"T. Valko" wrote:

Assumes no empty cells in the data range.


There's is a typo in that. What I meant to say was:

Assumes no empty cells in the DATE range.

To account for that:

=SUMPRODUCT(--(ISNUMBER(A1:A20)),--(MONTH(A1:A20)=3),--(B1:B20="x"))

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Well, I have empty cells, and the formula doesn't work.. The outcome of
the
formula is 6, should be 3 (in my worksheet, not in the example, in my
sheet
there are three hits, marked as "X" in the first three months.)

-Joona-

"T. Valko" wrote:

One way...

Assumes no empty cells in the data range.

=SUMPRODUCT(--(MONTH(A1:A20)=3),--(B1:B20="x"))

--
Biff
Microsoft Excel MVP


"Joona" wrote in message
...
Hello!

I', having a slight problem with my Excel-worksheet. I have a sheet
with
data, like this:

A B
1.1.2010 X
2.2.2010 X
3.3.2010
4.4.2010 X


(A: DDMMYYYY)
How do I get Excel to count all the X:s in the first three months? I
have
another sheet to gather this data in which I'm putting the formula.



.



.



 




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:28 AM.


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