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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
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.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,806
Members
449,048
Latest member
greyangel23

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
Back
Top