Column A (range "NAICS07") & B (range "NAICS12") in worksheet "TEST" contain a list of codes.
Column E (range "NAICSwhisardViol") in worksheet "violators" is also a list of codes, but may contain replicates of one or more codes.
I want to count the number of times a code in ranges "NAICS07" or "NAICS12" shows up in range "NAICSwhisardViol" for a particular Fiscal Year (Column B range "FiscalYearViol" in worksheet "violators").
I want the total count for a particular code per designated fiscal year to be placed in the appropriate cell in columns L or M of worksheet "TEST".
If a particular code doesn't show up in the "violators" worksheet, I want to return a value of "" (empty) in the appropriate cell in Column L or M of worksheet "TEST".
Could anyone out there help me with this? Thank you!!
PRACTICE.xlsm
p.s. I have tried SUMPRODUCT(('violators'!D:D=A7)*('violators'!A:A="2010")) in cell L7 of "TEST" but it doesn't work when applied to all cells in that column. In my function field Excel 2010 deletes the single quotes around 'violators' when I hit return and I don't know why.
12/30/2012: note -- another question coming out of this original semi-solved question was posted at http://www.mrexcel.com/forum/excel-q...eria-help.html on 12/29/2012 in the 11am hour. It has been partially, but not completely solved as of 4pm 12/30/2012. Here's the status:
HOW TO COUNT THE NUMBER OF VIOLATORS BY NAICS CODE in one worksheet, and place the total count in the appropriate cell corresponding to that NAICS in a different worksheet
CODES TO MATCH ARE IN 1 COLUMN
=COUNTIFS(NAICSwhisardViol, B11, FiscalYEAR,"2010")
=COUNTIFS(NAICSwhisardViol, B11, FiscalYEAR,"2011")
CODES TO MATCH ARE IN either one or the other column of 2 DIFFERENT COLUMNS (NAICS07 & NAICS12)
=COUNTIFS(NAICSwhisardViol, IF(ISBLANK(B11)=TRUE,C11,B11), FiscalYEAR,"2010")
=COUNTIFS(NAICSwhisardViol, IF(ISBLANK(B11)=TRUE,C11,B11), FiscalYEAR,"2011")
=SUM(IF((NAICSwhisardViol=A7)+(NAICSwhisardViol=B7), IF(FiscalYEAR=2011,1)))…THIS IS A BAD ONE.
=SUM(IF((NAICSwhisardViol=A7)+(NAICSwhisardViol=B7), IF(FiscalYEAR="2011",1)))…THIS IS A BAD ONE TOO.
We are trying to figure out if my computer doesn’t handle array functions because it doesn’t have enough memory.
I can’t get any related SUMPRODUCT functions to work either.
12/30/2012 5:30pm: THIS POST IS AS SOLVED AS IT CAN GET. THE ISSUE WITH SUMIF and SUMPRODUCT cannot be solved at this time and time has run out for me. Am going to stick with COUNTIFS functions above. THANKS EVERYONE!
Bookmarks