You are here:

Excel/To count repeated entries in a given month

Advertisement


Question
Image 1
Image 1  
Hi Jerry,
I have a table with all the dates of the year (from 1st Jan to 31st Dec) in a row(1).
rows 2,3,4... have names.

on a daily basis - attendance is give as P(Present) or A(Absent) or left blank in special cases.

below i have a summary against these names. i have created a drop down list of months (highlighted in image).

i would like to compute the count of P's, A's & blanks against each name in the month selected from the drop down. so, if FEBRUARY is selected - E12 shows no. of P's against AAA in February;H12 shows no. of A's against AAA in February;H12 shows no. of blanks against AAA in February. hope i haven't complicated this too much. I was trying out COUNTIF & COUNTIFS but cant seem to make it work.

Your help is appreciated. Thanks

Answer
I only created a table out to column BT, you'll need to adjust this formula out to cover all the columns you're using.

The formula in B12 would be:

   =SUMPRODUCT(($B$2:$BT$4=B$11)*(TEXT($B$1:$BT$1,"MMMM")=$B$10)*($A$2:$A$4=$A12))

After you adjust that to match your column range, copy that down and across through column E.

For the BLANK column, the formula in H12 would be:

   =SUMPRODUCT(($B$2:$BT$4="")*(TEXT($B$1:$BT$1,"MMMM")=$B$10)*($A$2:$A$4=$A12))
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Jerry Beaucaire

Expertise

Excel Formulas, macros, automation. Microsoft Excel MVP - 2010. Code site with free code snippets and techniques: http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/files

Experience

Microsoft Excel MVP - 2010. I have my own extensive Excel help/code site: http://sites.madrocketscientist.com/jerrybeaucaires-excelassistant/files ===================== I have been offering free assistance as an Excel aid on many web sites for many years: (http://www.excelforum.com - JBeaucaire) ======== (http://www.askmehelpdesk.com/spreadsheets - JBeaucaire) ======= (http://www.mrexcel.com/forum - jbeaucaire)

Education/Credentials
Bachelor's Degree from Azusa Pacific University in Mathematics and Music Composition

Awards and Honors
Microsoft Excel MVP 2010

©2016 About.com. All rights reserved.