Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Two conditional IF statement using Month function (https://www.askmehelpdesk.com/showthread.php?t=182887)

  • Feb 11, 2008, 12:01 PM
    Jill622
    Two conditional IF statement using Month function
    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!
  • Feb 11, 2008, 02:36 PM
    ebaines
    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.

  • All times are GMT -7. The time now is 02:12 AM.