Using Excel to create count number report

%3CLINGO-SUB%20id%3D%22lingo-sub-2753933%22%20slang%3D%22en-US%22%3EUsing%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2753933%22%20slang%3D%22en-US%22%3E%3CP%3EI%20use%20Excel%202007%20on%20Windows%2010.%20I%20have%20a%20database%20of%20employee%20pay%20for%2012%20months.%20I%20am%20trying%20to%20produce%20a%20report%20showing%20how%20many%20employees%20were%20paid%20each%20month.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2753933%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2754020%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2754020%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1156849%22%20target%3D%22_blank%22%3E%40levicnhotmailcom%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20are%20several%20ways%20to%20do%20that%3C%2FP%3E%3CP%3EPivot%20table%2C%20Formulas%2C%20Power%20Query%2C%20etc.%3C%2FP%3E%3CP%3EI'm%20attaching%202%20different%20solutions%20so%20you%20can%20choose%20witch%20one%20is%20best%20for%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JulianoPetrukio_0-1631731713954.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310642i6CE25D3240EB474C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JulianoPetrukio_0-1631731713954.png%22%20alt%3D%22JulianoPetrukio_0-1631731713954.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2754091%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2754091%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F767933%22%20target%3D%22_blank%22%3E%40Juliano-Petrukio%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESadly%2C%20a%20straight%20pivot%20table%20doesn't%20answer%20the%20question.%20I%20tried%20that%20too.%20The%20original%20question%20was%20%22how%20many%20employees%20were%20paid%20each%20month%3F%22%20There%20were%20indeed%20124%20payments%20in%20January%2C%20but%20only%2061%20employees%20receiving%20those%20124%20payments.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20stymied%20by%20this%20one.....still%20haven't%20figured%20it%20out.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESheet2%20in%20the%20attached%20shows%20the%20detail%20behind%20the%20Pivot%20Table's%20count%20for%20Jan.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2754179%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2754179%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1156849%22%20target%3D%22_blank%22%3E%40levicnhotmailcom%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETwo%20intervening%20steps%2C%20partly%20for%20sake%20of%20repeatability.%20There%20may%20well%20be%20more%20efficient%20ways%2C%20using%20Power%20Query%20or%20the%20like%20(which%20I%20don't%20have%20on%20the%20Mac)%2C%20but%20this%20is%20for%20clarity%20and%20repeatability.%3C%2FP%3E%3CUL%3E%3CLI%3Eadded%20a%20column%20which%20yield%20the%20month%20number%20(e.g.%2C%20Jan%20becomes%201)%20using%20the%20formula%20%3DMONTH(date)%3C%2FLI%3E%3CLI%3Ethen%20the%20new%20function%20UNIQUE%20to%20develop%20a%20table%20that%20consists%20of%20each%20unique%20occurrence%20of%20month%20and%20name%2C%3C%2FLI%3E%3CLI%3Ewith%20all%20of%20that%20followed%20by%20a%20simple%20Pivot%20Table%2C%20an%20image%20of%20which%20is%20below.%26nbsp%3BThe%20full%20sheet%20is%20attached.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mathetes_0-1631735131091.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310677i69510455032F9408%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mathetes_0-1631735131091.png%22%20alt%3D%22mathetes_0-1631735131091.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2754185%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2754185%22%20slang%3D%22en-US%22%3EHe%20is%20using%20Excel%202007.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2754819%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2754819%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1156849%22%20target%3D%22_blank%22%3E%40levicnhotmailcom%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAre%20you%20able%20to%20update%20your%20software%20to%20the%20most%20recent%20version%20of%20Excel%3F%20The%20UNIQUE%20function%20that%20I%20used--as%20well%20as%20many%20other%20new%20features%20that%20are%20quite%20powerful--are%20simply%20not%20available%20on%20your%20edition%2C%20as%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F767933%22%20target%3D%22_blank%22%3E%40Juliano-Petrukio%3C%2FA%3E%26nbsp%3Bhas%20correctly%20pointed%20out.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2754910%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2754910%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1156849%22%20target%3D%22_blank%22%3E%40levicnhotmailcom%3C%2FA%3E%26nbsp%3BSince%20both%20modern%20functions%20and%20Power%20Query%20are%20not%20available%20for%20your%20Excel%20version.%20A%20regular%20pivot%20table%20counting%20the%20number%20of%20payments%20per%20person%20per%20month%20can%20be%20the%20basis%20for%20counting%20the%20number%20of%20cells%20with%20values%20each%20month.%20A%20working%20example%20in%20the%20attached%20xls%20file%20is%20attached.%20It%20should%20work%20in%20your%20version.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2756390%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2756390%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20I%20have%20considered%20updating%20my%20software%20version%2C%20but%20do%20not%20buy%20into%20subscription%20as%20a%20way%20towards%20achieving%20the%20goal.%20I%20prefer%20to%20buy%20a%20software%20and%20use%20it%20the%20best%20way%20I%20see%20fit.%26nbsp%3B%20The%20current%20subscription%20method%20by%20Microsoft%20has%20forced%20many%20people%20I%20may%20say%2C%20including%20myself%20to%20continue%20using%20old%20non-supported%20software.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20did%20a%20marvelous%20job%20creating%20those%20result.%20I%20wished%20I%20had%20the%20updated%20software%20to%20recreate%20it.%20Thanks%20for%20the%20superlative%20effort.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2756510%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2756510%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGreat%20solution%20for%20the%20older%20software!%20Well%20done.%20Once%20again%2C%20Excel%20excels%20in%20having%20multiple%20ways%20to%20go%20from%20A%20to%20B.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2756554%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Excel%20to%20create%20count%20number%20report%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2756554%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1156849%22%20target%3D%22_blank%22%3E%40levicnhotmailcom%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInspired%20by%20the%20solution%20offered%20by%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%2C%20and%20totally%20building%20off%20his%20initial%20results%2C%20I%20created%20the%20attached%20sheet%2C%20showing%20how%20his%20initial%20pivot%20table%20(which%20you%20can%20readily%20create%20with%20last%20year's%20or%20the%20current%20partial%20year's%20actual%20data)%20can%20be%20used%20to%20answer%20two%20questions%3A%3C%2FP%3E%3CUL%3E%3CLI%3Eyour%20original%20question%20%22How%20many%20employees%20were%20paid%20each%20month%3F%22%3C%2FLI%3E%3CLI%3Ebut%20also%2C%20%22How%20many%20months%20of%20the%20year%20did%20each%20employee%20work%3F%22%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20both%20cases%2C%20it's%20just%20a%20matter%20of%20counting%20the%20number%20of%20cells%20in%20the%20Pivot%20Table%20that%20were%20filled%20with%20a%20number.%3C%2FP%3E%3CUL%3E%3CLI%3EDoing%20that%20vertically%20tells%20you%20how%20many%20employees%3B%3C%2FLI%3E%3CLI%3EDoing%20it%20horizontally%20tells%20you%2C%20for%20each%20employee%2C%20the%20number%20of%20months.%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I use Excel 2007 on Windows 10. I have a database of employee pay for 12 months. I am trying to produce a report showing how many employees were paid each month.

17 Replies

@levicnhotmailcom 

 

There are several ways to do that

Pivot table, Formulas, Power Query, etc.

I'm attaching 2 different solutions so you can choose witch one is best for you.

 

JulianoPetrukio_0-1631731713954.png

 

@Juliano-Petrukio 

 

Sadly, a straight pivot table doesn't answer the question. I tried that too. The original question was "how many employees were paid each month?" There were indeed 124 payments in January, but only 61 employees receiving those 124 payments.

 

I was stymied by this one.....still haven't figured it out.

 

Sheet2 in the attached shows the detail behind the Pivot Table's count for Jan.

@levicnhotmailcom 

 

Two intervening steps, partly for sake of repeatability. There may well be more efficient ways, using Power Query or the like (which I don't have on the Mac), but this is for clarity and repeatability.

  • added a column which yield the month number (e.g., Jan becomes 1) using the formula =MONTH(date)
  • then the new function UNIQUE to develop a table that consists of each unique occurrence of month and name,
  • with all of that followed by a simple Pivot Table, an image of which is below. The full sheet is attached.

mathetes_0-1631735131091.png

 

He is using Excel 2007.

@levicnhotmailcom 

 

Are you able to update your software to the most recent version of Excel? The UNIQUE function that I used--as well as many other new features that are quite powerful--are simply not available on your edition, as @Juliano-Petrukio has correctly pointed out.

@levicnhotmailcom Since both modern functions and Power Query are not available for your Excel version. A regular pivot table counting the number of payments per person per month can be the basis for counting the number of cells with values each month. A working example in the attached xls file is attached. It should work in your version.

@mathetes 

Yes, I have considered updating my software version, but do not buy into subscription as a way towards achieving the goal. I prefer to buy a software and use it the best way I see fit.  The current subscription method by Microsoft has forced many people I may say, including myself to continue using old non-supported software. 

 

You did a marvelous job creating those result. I wished I had the updated software to recreate it. Thanks for the superlative effort. 

@Riny_van_Eekelen 

 

Great solution for the older software! Well done. Once again, Excel excels in having multiple ways to go from A to B.

@levicnhotmailcom 

 

Inspired by the solution offered by @Riny_van_Eekelen, and totally building off his initial results, I created the attached sheet, showing how his initial pivot table (which you can readily create with last year's or the current partial year's actual data) can be used to answer two questions:

  • your original question "How many employees were paid each month?"
  • but also, "How many months of the year did each employee work?"

 

In both cases, it's just a matter of counting the number of cells in the Pivot Table that were filled with a number.

  • Doing that vertically tells you how many employees;
  • Doing it horizontally tells you, for each employee, the number of months.
@Riny_van_Eekelen
Thank you for creating the absolute solution. I have reviewed the result and best of all, can use my current software to arrive at same result. I appreciate your good work.
Glad I could help
I ran into a glitch while trying to re-create your solution to the count problem with the Pivot table. How you linked the sum of values to the Names, and how you created the months of the year. Everything I did mirrored your output.

@levicnhotmailcom 

Well, I'm not a big fan of auxiliar columns nor complex matrices formulas because with a huge dataset it jeopardises the performance.

Anyway, find attached 2 possible solutions you can try them.

 

JulianoPetrukio_0-1632182077923.png

 

 

 

 

{=SUM(IF((MONTH(DateColumn)=MonthID)*MATCH(MONTH(DateColumn)&EmployeeColumn;MONTH(DateColumn)&EmployeeColumn;0)=MATCH(ROW(EmployeeColumn);ROW(EmployeeColumn));1;0))}

 

 

 

 

 

 

I still couldn't make out how the "month" column came in place. It is not in the data sheet.

@levicnhotmailcom 

 

There is no column named as MONTH.

There is a report where you can see month by month the result of the payments (quantity and summation)

 

When we put a date on a column we can manage it with some different date formulas such as Month(Date).

Have a look, I posted a file with the same data provided by you.

@Juliano-Petrukio  

I am totally lost on how you used the date to produce "Month" column under the PivotTable Field List. I believe this goes to your statement that "When we put a date on a column we can manage it with some different date formulas such as Month(Date)".

 

@levicnhotmailcom 

 

Excel auto identifies that the field is a date type field and then group it in:
Years > Quarters > Months > Full date.
I'm not sure if Excel 2007 version does that, but take a look on this article

 

Ps.: Dont forget to hit the like button and mark as solved if its solved.