adding a counta to a sumproduct

Stephanie2021

New Member
Joined
Feb 15, 2021
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
I am trying to count how many cells are not empty that matches up to the supervisor in the sample below

Training Score Card.xlsx
ABCDEFGHIJK
1NEW HIRE - DOES NOT NEED PRIOR MONTH TRAINING COMPLETEDJANUARY 2021 TRAINING SCORE CARD
2Hire DateAssociate NamePositionTeamSupervisorAmmonia Awareness PPTTRAINER INITIALSEmployee Ammonia Awareness Sign OffTRAINER INITIALSSerious Safety Policy
31/1/21Jose DoeWorker1Jose1/22/20JA1/22/20JA1/22/20
41/1/21Joaquin DoeWorker1Brian1/22/21BE1/22/21BE1/22/21
51/1/21JohnDoeWorker1Hector1/11/21HS1/11/21HS1/11/21
61/1/21JosephDoeWorker1Joe1/19/21JB1/19/21JB1/19/21
71/1/21SallyDoeWorker1Sally1/27/211/27/21
81/1/21RaymundoDoeWorker1Brian1/22/21BE1/22/21BE1/22/21
91/1/21BrianDoeWorker1Joe1/19/21JB1/19/21JB1/19/21
101/1/21Michael DoeWorker1Hector1/11/21HS1/11/21HS1/11/21
111/1/21KapriDoeWorker1Chris1/25/21CG1/25/21CG1/25/21
121/1/21Gerardo DoeWorker1David1/25/21DI1/25/21DI1/25/21
131/1/21BrianDoeWorker1Brian1/22/21BE1/22/21BE1/22/21
141/1/21JohnDoeWorker1Hector1/11/21HS1/11/21HS1/11/21
151/1/21WesleyDoeWorker1Brian1/22/21BE1/22/21BE1/22/21
161/1/21Leopoldo DoeWorker1Hector1/11/21hs1/11/21hs1/11/21
171/1/21SantiagoDoeWorker1David1/25/21DI1/25/21DI1/25/21
181/1/21Chris DoeWorker1Chris1/25/21CG1/25/21CG1/25/21
191/1/21KyleDoeWorker1Joe1/19/21JB1/19/21JB1/19/21
201/1/21PeterDoeWorker1Brian1/22/21BE1/22/21BE1/22/21
January
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J18Celldoes not contain a blank value textNO
I18Celldoes not contain a blank value textNO
K11Celldoes not contain a blank value textNO
J11Celldoes not contain a blank value textNO
I11Celldoes not contain a blank value textNO
K18Celldoes not contain a blank value textNO
K17:L17Celldoes not contain a blank value textNO
I17:J17Celldoes not contain a blank value textNO
G17:H17Celldoes not contain a blank value textNO
K12:L12Celldoes not contain a blank value textNO
I12:J12Celldoes not contain a blank value textNO
K26,K16Celldoes not contain a blank value textNO
I26,I16Celldoes not contain a blank value textNO
J59:J60,J26,J16,J14,J10,J5Celldoes not contain a blank value textNO
I14,K14Celldoes not contain a blank value textNO
I10,K10Celldoes not contain a blank value textNO
I5,K5Celldoes not contain a blank value textNO
I3:J4,I25:J25,J61,I21,I8:J8,I13:J13,I15:J15,I20:J20,I27:J27,I36:J37,I39:J39,I45:J46,I48:J48,I53:J53,I56:J56Celldoes not contain a blank value textNO
K3:L4,K25:L25,K21,K8:L8,K15:L15,K20:L20,K27:L27,K36:L37,K39:L39,K45:L46,K48:L48,K53:L53,K56:L56,K13:L13Celldoes not contain a blank value textNO
I59,K59,K61:L61,I6:L7,I19:L19,I28:L28,I38:L38,I47:L47,I49:L51,I54:L55,I58:L58,G25:H28,I9:M9,M3:T62,G45:H51,G53:H56,G58:H61,G3:H16,G18:H21,G30:L30,I32:L35,I40:L43,G32:H43Celldoes not contain a blank value textNO
 
I'm kind of late to the party, but try this variation of Zot's formula:

=SUMPRODUCT((F3:F20=N3)*(H3:J20<>""))
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I'm kind of late to the party ....
... but with impeccable timing!

@Stephanie2021, I was guessing it would make more sense to count only columns H and J (perhaps only if there were also corresponding dates in G and I?)

That way you are counting only the number of training tasks completed by the trainer, rather than a mix of initial and date fields?
 
Upvote 0
... but with impeccable timing!

@Stephanie2021, I was guessing it would make more sense to count only columns H and J (perhaps only if there were also corresponding dates in G and I?)

That way you are counting only the number of training tasks completed by the trainer, rather than a mix of initial and date fields?

I understand the redundancy, but there is actually an average of 75 or better columns. I much rather divide by 2 than have to set up individual column formulas. If there is a way to add in a count for every other I am all for it!

thank you so much for the follow up :)
 
Upvote 0
Yes, you can pick up every 2nd column using a formula.

I'll post back later (but secretly hoping Eric W beats me to it).
 
Upvote 0
I'll post back later (but secretly hoping Eric W beats me to it).
LOL! ?

It's not a big change:

Book3
ABCDEFGHIJKLMNO
1NEW HIRE - DOES NOT NEED PRIOR MONTH TRAINING COMPLETEDJANUARY 2021 TRAINING SCORE CARDHector8
2Hire DateAssociate NamePositionTeamSupervisorAmmonia Awareness PPTTRAINER INITIALSEmployee Ammonia Awareness Sign OffTRAINER INITIALSSerious Safety Policy
344197Jose DoeWorker1Jose43852JA43852JA43852
444197Joaquin DoeWorker1Brian44218BE44218BE44218
544197JohnDoeWorker1Hector44207HS44207HS44207
644197JosephDoeWorker1Joe44215JB44215JB44215
744197SallyDoeWorker1Sally4422344223
844197RaymundoDoeWorker1Brian44218BE44218BE44218
944197BrianDoeWorker1Joe44215JB44215JB44215
1044197Michael DoeWorker1Hector44207HS44207HS44207
1144197KapriDoeWorker1Chris44221CG44221CG44221
1244197Gerardo DoeWorker1David44221DI44221DI44221
1344197BrianDoeWorker1Brian44218BE44218BE44218
1444197JohnDoeWorker1Hector44207HS44207HS44207
1544197WesleyDoeWorker1Brian44218BE44218BE44218
1644197Leopoldo DoeWorker1Hector44207hs44207hs44207
1744197SantiagoDoeWorker1David44221DI44221DI44221
1844197Chris DoeWorker1Chris44221CG44221CG44221
1944197KyleDoeWorker1Joe44215JB44215JB44215
2044197PeterDoeWorker1Brian44218BE44218BE44218
Sheet1
Cell Formulas
RangeFormula
O1O1=SUMPRODUCT((F3:F20=N1)*(H3:J20<>"")*(MOD(COLUMN(H3:J3),2)=0))



Note the part in red:
=SUMPRODUCT((F3:F20=N1)*(H3:J20<>"")*(MOD(COLUMN(H3:J3),2)=0))

I don't know how much you know about MOD. In this case, H is an even column (8), I is odd (9), and J is even (10). MOD turns those column numbers into 0,1,0. And the formula only looks at the columns that become 0. If you want the odd columns, change the "=0" to "=1". If you use

(MOD(COLUMN(H3:J3),3)=0)

instead, you can look at only every third column.
 
Upvote 0
LOL! ?

It's not a big change:

Book3
ABCDEFGHIJKLMNO
1NEW HIRE - DOES NOT NEED PRIOR MONTH TRAINING COMPLETEDJANUARY 2021 TRAINING SCORE CARDHector8
2Hire DateAssociate NamePositionTeamSupervisorAmmonia Awareness PPTTRAINER INITIALSEmployee Ammonia Awareness Sign OffTRAINER INITIALSSerious Safety Policy
344197Jose DoeWorker1Jose43852JA43852JA43852
444197Joaquin DoeWorker1Brian44218BE44218BE44218
544197JohnDoeWorker1Hector44207HS44207HS44207
644197JosephDoeWorker1Joe44215JB44215JB44215
744197SallyDoeWorker1Sally4422344223
844197RaymundoDoeWorker1Brian44218BE44218BE44218
944197BrianDoeWorker1Joe44215JB44215JB44215
1044197Michael DoeWorker1Hector44207HS44207HS44207
1144197KapriDoeWorker1Chris44221CG44221CG44221
1244197Gerardo DoeWorker1David44221DI44221DI44221
1344197BrianDoeWorker1Brian44218BE44218BE44218
1444197JohnDoeWorker1Hector44207HS44207HS44207
1544197WesleyDoeWorker1Brian44218BE44218BE44218
1644197Leopoldo DoeWorker1Hector44207hs44207hs44207
1744197SantiagoDoeWorker1David44221DI44221DI44221
1844197Chris DoeWorker1Chris44221CG44221CG44221
1944197KyleDoeWorker1Joe44215JB44215JB44215
2044197PeterDoeWorker1Brian44218BE44218BE44218
Sheet1
Cell Formulas
RangeFormula
O1O1=SUMPRODUCT((F3:F20=N1)*(H3:J20<>"")*(MOD(COLUMN(H3:J3),2)=0))



Note the part in red:
=SUMPRODUCT((F3:F20=N1)*(H3:J20<>"")*(MOD(COLUMN(H3:J3),2)=0))

I don't know how much you know about MOD. In this case, H is an even column (8), I is odd (9), and J is even (10). MOD turns those column numbers into 0,1,0. And the formula only looks at the columns that become 0. If you want the odd columns, change the "=0" to "=1". If you use

(MOD(COLUMN(H3:J3),3)=0)

instead, you can look at only every third column.

you gentlemen are changing my life! I did not know of MOD! I will definitely play with this one
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

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