Sumproduct on a table

niheav

New Member
Joined
Oct 11, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all, apologies if there is an answer to something along these lines already, but I have extensively searched and I can't find anything to apply to this issue.

I have a formula that works the way I want it to, however I want to apply similar formulas to 2 tables which need independent filters (therefore formatted as a table) - when I convert to a table the formula no longer works.

What I am trying to do is keep track of attendance, so dynamic dates and I want it filtered by the year of birth of the participant and counting the "Yes" in the appropriate column:

1665524708913.png



This is the screenshot oof what I have
The formulas in J2 worked pre formatting as table, and that formula is:

=SUMPRODUCT(($C$1:$F$16="Yes")*($C$1:$F$1=$K$2)*($A$1:$A$16=H2))

However if I try change this to table format of:
=SUMPRODUCT((Table2[[#All],[08/10/2022]:[17/09/2022]]="Yes")*(Table2[[#Headers],[08/10/2022]:[17/09/2022]]=$K$2)*(Table2[[#All],[Year Born]]=H2))

I then get a result of 0

Any help much appreciated!

Thanks,

N
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to the MrExcel forum!

How about:

Book1
ABCDEFGHIJK
1Year BornPlayer Name10/8/202210/1/20229/24/20229/17/2022For Date:
22000Player 1YesYesYes2002Players210/8/2022
32000Player 2YesYes2001Players1
42000Player 3YesYes2000Players2
52001Player 4YesYesYesYes
62002Player 5YesYes
72002Player 6NoYesYes
82002Player 7Yes
Sheet1
Cell Formulas
RangeFormula
J2:J4J2=SUMPRODUCT((Table1[#Data]="Yes")*(Table1[Year Born]=H2)*(Table1[#Headers]=TEXT($K$2,"m/d/yyyy")))


I used [#Headers] instead of trying to use the starting/ending dates as you did. It ends up checking more cells than it has to, but the formula is shorter. Also, apparently when a date becomes a header in a table, it becomes text data. That's why I needed to use the TEXT function in the formula.

Hope this helps!
 
Upvote 0
Perfect!
That works a treat!

It was the text formatting that was catching me out!!

Appreciate your help and the quick turnaround!
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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