# Multiple conditions based on end of month

#### Binghamcornwall

##### New Member
I have a spreadsheet 'Log' that contains an eomonth formula '=EOMONTH(A4,0)', formatted to custom mmm-yy On a separate sheet I am trying to collate stats on the number of times two conditions are met, one of which is based on the end of month mentioned above.

The formula I am using is '{=SUM((Log!C4:C134="New")*(Log!X4:X134="May-10"))}, using control, shift and enter to enter the formula to establish {}.

The formula is consistently returning zero, when I know it should have a total. I am assuming the problem lies with the eomonth format. Can anyone help?

The solution may be simple, but I appear to be missing it. Many thanks.

### Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

#### xld

##### Banned
The format is irrelevant. Try

=SUM((Log!C4:C134="New")*(Log!X4:X134=--"31-May-10"))

#### AlphaFrog

##### MrExcel MVP
"May-10" is a text string and not an actual date.

Try something like this...
{=SUM((Log!C4:C134="New")*(Log!X4:X134=DATE(2010,5,31)))}

Or this
{=SUM((Log!C4:C134="New")*(Log!X4:X134=DATEVALUE("May 31, 2010")))}

#### njimack

##### Well-known Member
The formatting doesn't change the fact that your EOMONTH formula is actually returning a date. Try the following (non-array) approach:

=SUMPRODUCT(--(Log!C4:C134="New"),--(MONTH(Log!X4:X134)=MONTH(A4)),--(YEAR(Log!X4:X134)=YEAR(A4))

#### Binghamcornwall

##### New Member
Many thanks.

The formula that worked was =SUM((Log!C4:C134="New")*(Log!X4:X134=DATEVALUE("31 May 2010"))) entered as an array formula.

I missed the fact that May-10 was a text string, another lesson learnt!

Again many thanks for the help, it is much appreciated.

Replies
3
Views
510
Replies
7
Views
555
Replies
4
Views
397
Replies
0
Views
441
Replies
5
Views
333

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,787
Messages
5,833,696
Members
430,225
Latest member
RKB_Excel

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back