View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
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
...
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.