PDA

View Full Version : Two conditional IF statement using Month function


Jill622
Feb 11, 2008, 12:01 PM
I am trying to write a two conditional IF statement that sums up values in column C if for example column A = January and column B = category x. The result would be January sales for category x after querying a large spreadsheet of sales data.

Right now I'm using the following formula:
=SUMPRODUCT(--(MONTH('raw data'!$B$2:$B$18266= 2),--(('raw data'!$H$2:$H$18266) ="Acme"),'raw data'!$O$2:$O$18266)

For some reason, the month function doesn't seem to be working as I get the same answer regardless of what month I'm looking for. Theoretically, if the month is "2" it should return a 1, if the category is "Acme" it should return a 1 which would then multiply 1x1xraw data sales value. If either of the first two conditions are not true, they would give a zero which would return a zero for the full product.

Any thoughts on why the month function isn't working? Maybe the array?

Thanks!

ebaines
Feb 11, 2008, 02:36 PM
You are missing a close parenthesis in the first array - should be:

(--(MONTH('raw data'!$B$2:$B$18266)= 2),

Other than that, I tried a similar formula in my versoin of excel and it seems to work as intended. My only other suggestion is to try debugging this on a small set of data and see if you get the answer you want.