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  

Why can't I use the MONTH function within the SUMIFS statement?



 
 
Thread Tools Display Modes
  #1  
Old March 28th, 2010, 02:28 PM posted to microsoft.public.excel.worksheet.functions
djhunt77
external usenet poster
 
Posts: 2
Default Why can't I use the MONTH function within the SUMIFS statement?

I have a Detail worksheet with three named ranges: Category, DateOfService
and Amount.

I have a Summary worksheet where I am trying to summaries the amounts by
Category (represented by the rows) and Month (represented by the columns).

Why do I get an error when I try to use this formula on the Summary sheet?

=SUMIFS(Amount,Category,A2,Month(DateOfService),1)

where A2 is the first row in the summary data.
  #2  
Old March 28th, 2010, 02:38 PM posted to microsoft.public.excel.worksheet.functions
Bob Phillips[_3_]
external usenet poster
 
Posts: 489
Default Why can't I use the MONTH function within the SUMIFS statement?

You just can't, it's daft isn't it, makes SUMIFS more or less pointless IMO.

Try this

=SUMPRODUCT(--(Category=A2),--(Month(DateOfService)=1),Amount)

--

HTH

Bob

"djhunt77" wrote in message
news
I have a Detail worksheet with three named ranges: Category, DateOfService
and Amount.

I have a Summary worksheet where I am trying to summaries the amounts by
Category (represented by the rows) and Month (represented by the columns).

Why do I get an error when I try to use this formula on the Summary sheet?

=SUMIFS(Amount,Category,A2,Month(DateOfService),1)

where A2 is the first row in the summary data.



  #3  
Old March 28th, 2010, 05:20 PM posted to microsoft.public.excel.worksheet.functions
Ziggy
external usenet poster
 
Posts: 47
Default Why can't I use the MONTH function within the SUMIFS statement?

On Mar 28, 7:28*am, djhunt77
wrote:
I have a Detail worksheet with three named ranges: Category, DateOfService
and Amount.

I have a Summary worksheet where I am trying to summaries the amounts by
Category (represented by the rows) and Month (represented by the columns)..

Why do I get an error when I try to use this formula on the Summary sheet?

=SUMIFS(Amount,Category,A2,Month(DateOfService),1)

where A2 is the first row in the summary data.



Any chance that with "Category" and "A2" you are mixing text and
values? Or is your "DateOf Service" text?

Break it into single criteria and see where the problem is.

I use a formla just like that and it works fine.

Else Bob's SUMPRODUCT formula with the unary works fine.
  #4  
Old March 28th, 2010, 05:44 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Why can't I use the MONTH function within the SUMIFS statement?

Why do I get an error when I try to use this formula
=SUMIFS(Amount,Category,A2,Month(DateOfService),1 )


SUMIF
SUMIFS
COUNTIF
COUNTIFS
AVERAGEIF
AVERAGEIFS

These functions can only handle "straight" comparisons. That is, you can't
manipulate a range array to test for a condition.

In the formula above you're trying to manipulate the range array
DateOfService by first testing for the month.

MONTH(DateOfService) = 1

The test has to be a "straight" comparison:

DateOfService = 1

Of course, that doesn't do what you want so you need to use a different
function as Bob suggested.

--
Biff
Microsoft Excel MVP


"djhunt77" wrote in message
news
I have a Detail worksheet with three named ranges: Category, DateOfService
and Amount.

I have a Summary worksheet where I am trying to summaries the amounts by
Category (represented by the rows) and Month (represented by the columns).

Why do I get an error when I try to use this formula on the Summary sheet?

=SUMIFS(Amount,Category,A2,Month(DateOfService),1)

where A2 is the first row in the summary data.



  #5  
Old March 28th, 2010, 07:58 PM posted to microsoft.public.excel.worksheet.functions
Ziggy
external usenet poster
 
Posts: 47
Default Why can't I use the MONTH function within the SUMIFS statement?


Yu can use that convention if you're willing to use an array formula

e.g. this works. You'd have to change names etc.

~=SUM((DOSDEP=$B19)*(DOS_Acct =$C19)*(DOS_Acct =
$D19)*(MONTH(DOS)=MONTH($G$3))*(DOSAmount))

Here I'm looking up both the month of the range month and the column
header.

Siegfried

Ctrl-Shift-Enter
  #6  
Old March 29th, 2010, 12:36 AM posted to microsoft.public.excel.worksheet.functions
djhunt77
external usenet poster
 
Posts: 2
Default Why can't I use the MONTH function within the SUMIFS statement

Thanks Bob - that suggestion worked perfectly!

"Bob Phillips" wrote:

You just can't, it's daft isn't it, makes SUMIFS more or less pointless IMO.

Try this

=SUMPRODUCT(--(Category=A2),--(Month(DateOfService)=1),Amount)

--

HTH

Bob

"djhunt77" wrote in message
news
I have a Detail worksheet with three named ranges: Category, DateOfService
and Amount.

I have a Summary worksheet where I am trying to summaries the amounts by
Category (represented by the rows) and Month (represented by the columns).

Why do I get an error when I try to use this formula on the Summary sheet?

=SUMIFS(Amount,Category,A2,Month(DateOfService),1)

where A2 is the first row in the summary data.



.

 




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 08:31 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.