Countifs / sumproducts to count value based on column header

p4nny

Board Regular
Joined
Jan 13, 2015
Messages
246
06/10/201729/09/201722/09/2017
BA1yy
BA2Yy
BA3yy
BA4y

<tbody>
</tbody>


Hi,

This is an example of how my dataset looks.

I'm looking to count the number of "Y"'s in any specified week so if I type 22/09/2017 in a cell, it would count the number of "Y"'s in that column

Much appreciated

Many thanks in advance,
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi

B1:D1 houses the dates, in W1 = 22/09/2017


=SUMPRODUCT((B2:D100="Y")*(B1:D1=W1))

----

If you'd need to add another condition (example: "Y" per "BA3" under date in W1):

=SUMPRODUCT((B2:D100="Y")*(B1:D1=W1)*(A2:A100="BA3"))


Regards
 
Last edited:
Upvote 0
Great thank you..

Rather than "Y", if I was have a criteria of "DOES NOT EQUAL BLANK", how would I do that?

Many thanks again
 
Upvote 0
Hi again

same data layout

=SUMPRODUCT((B2:D100<>"")*(B1:D1=W1))

=SUMPRODUCT(NOT(ISBLANK(B2:D100))*(B1:D1=W1))

Regards
 
Upvote 0

Forum statistics

Threads
1,215,143
Messages
6,123,280
Members
449,094
Latest member
GoToLeep

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