# Count based on dates in different column

#### sprytgrrl

##### New Member
Hi! This question has probably been asked a million times before but I still can't get my formulas to work right! Here's what I'm trying to do.

On SheetX!A1, count SheetZ!B:B >DateB IF SheetZ!A:A < DateA

So...On SheetX!A1, count SheetZ!B:B >2/28/2010 only IF SheetZ!A:A < 2/1/2010

Column: A B
1/1/2010 3/1/2010
1/15/2010 2/1/2010
2/19/2010 3/1/2010
2/28/2010 2/1/2010

The count would be one. I've tried sumproduct but get a #Num error.
=SUMPRODUCT((Jan20110302!H:H<DATE(2011,1,1)),(Jan20110302!M:M>=DATE(2011,1,31)))
Thank you!!

Last edited:

### Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

#### VoG

##### Legend
Hi. Try like this

=SUMPRODUCT(--(Jan20110302!H1:H100<=DATE(2011,2,28)),--Jan20110302!H1:H100>DATE(2010,2,1)))

#### njimack

##### Well-known Member
=sumproduct(--(z!\$b\$1:\$b\$4>40237),--(z!\$a\$1:\$a\$4<40210))

#### sprytgrrl

##### New Member
Dumb question.... do i leave the dashes -- in or does that represent something?

#### VoG

##### Legend
Leave them in or the formulas won't work.

#### sprytgrrl

##### New Member
That worked. Thank you both!!

Replies
10
Views
469
Replies
12
Views
553
Replies
21
Views
535
Replies
0
Views
329
Replies
2
Views
1K

1,191,171
Messages
5,985,067
Members
439,938
Latest member
MAlhash

### 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