Question

PKinG

New Member
Joined
Nov 15, 2005
Messages
2
:rolleyes:
hi,

I've developed a function that will count the number of items in a column between two dates. The function works fine at the moment:

=COUNTIF(Sheet1!U:U,"<="&DATE(2004,11,31))-COUNTIF(Sheet1!U:U,"<"&DATE(2004,11,1))

I now want to modify the function so it only counts between two dates if the name in column D matches for example 'Danny'. How would I go about this?

thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
PKinG said:
:rolleyes:
hi,

I've developed a function that will count the number of items in a column between two dates. The function works fine at the moment:

=COUNTIF(Sheet1!U:U,"<="&DATE(2004,11,31))-COUNTIF(Sheet1!U:U,"<"&DATE(2004,11,1))

I now want to modify the function so it only counts between two dates if the name in column D matches for example 'Danny'. How would I go about this?

thanks

With X2 housing a first day date like 1-Nov-2004 and Y2 a name like Danny...

=SUMPRODUCT(--(Sheet1!$U$2:$U$100-DAY(Sheet1!$U$2:$U$100)+1=X2),--(Sheet1!$D$2:$D$100=Y2))

Note that that this type of formulas do not admit whole columns like U:U as reference.
 
Master Excel Bundle

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.

Forum statistics

Threads
1,168,119
Messages
5,857,487
Members
431,882
Latest member
saaaaaaaaaaaaaaaaaaaaaa

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top