Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Enhance sumproduct to return unique employee code count

Looking for a way to enhance this sumproduct expression
to return a unique employee code count:

=SUMPRODUCT((Month_of_Occurence=$B$2)*(Month_of_O ccurence<=$B$3)*(Branch=$B10))

Suppose the expression above returns: 5

In a corresponding named range: EmpCode
(range not used in the expression as yet)
the 5 instances returned are due to eg:

Emp1
Emp2
Emp1
Emp3
Emp2

Would like to return a unique employee code count of: 3
for the 5 instances. Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Enhance sumproduct to return unique employee code count

=COUNT(1/IF((Month_of_Occurence=$B$2)*(Month_of_Occurence< =$B$3),MATCH(Employees,Employees,0)=ROW(Employees)-MIN(ROW(Employees))+1))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.
Excel will automatically enclose the formula in braces (curly brackets), do
not try to do this manually.
When editing the formula, it must again be array-entered.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Max" wrote in message
...
Looking for a way to enhance this sumproduct expression
to return a unique employee code count:

=SUMPRODUCT((Month_of_Occurence=$B$2)*(Month_of_O ccurence<=$B$3)*(Branch=$B10))

Suppose the expression above returns: 5

In a corresponding named range: EmpCode
(range not used in the expression as yet)
the 5 instances returned are due to eg:

Emp1
Emp2
Emp1
Emp3
Emp2

Would like to return a unique employee code count of: 3
for the 5 instances. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Enhance sumproduct to return unique employee code count

Try this ARRAY FORMULA, committed with CTRL+SHIFT+ENTER, instead of just
ENTER:

=SUMPRODUCT(--(FREQUENCY(IF((Month_of_Occurence=$B$2)*
(Month_of_Occurence<=$B$3)*(Branch=$B$10),MATCH(Em pcode,Empcode,0)),
ROW(Empcode)-MIN(ROW(Empcode)))0))

That formula assumes there is a 3rd range named EmpCode.

Does that help?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Max" wrote in message
...
Looking for a way to enhance this sumproduct expression
to return a unique employee code count:

=SUMPRODUCT((Month_of_Occurence=$B$2)*(Month_of_O ccurence<=$B$3)*(Branch=$B10))

Suppose the expression above returns: 5

In a corresponding named range: EmpCode
(range not used in the expression as yet)
the 5 instances returned are due to eg:

Emp1
Emp2
Emp1
Emp3
Emp2

Would like to return a unique employee code count of: 3
for the 5 instances. Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Enhance sumproduct to return unique employee code count

Thanks, Ron. That worked swell.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Enhance sumproduct to return unique employee code count

Bob, thanks.

I adapted your suggestion to suit:

=COUNT(1/IF((Month_of_Occurence=$B$2)*(Month_of_Occurence< =$B$3)*(Branch=$B10),MATCH(EmpCode,EmpCode,0)=ROW( EmpCode)-MIN(ROW(EmpCode))+1))

and tested it out. Some results were okay but some were out (lower than
actuals). I'm not sure if I had adapted it correctly above?

Ron's suggestion returned correct results.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Enhance sumproduct to return unique employee code count

You're welcome....I'm glad I could help.

--------------------------
Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Max" wrote in message
...
Thanks, Ron. That worked swell.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attempting to sort unique/only count first record in each unique g MJW[_2_] Excel Discussion (Misc queries) 3 August 10th 07 02:56 PM
Count Employee Work Time - Don't Count Duplicates J Excel Worksheet Functions 3 May 1st 07 10:47 PM
Count Employee Work Time - Don't Double-count Overlapping Apts. J Excel Worksheet Functions 0 April 27th 07 05:52 AM
Enhance Sort Results maperalia Excel Discussion (Misc queries) 6 January 17th 07 11:11 PM
Return employee name when the employee's number is entered Mike Excel Worksheet Functions 1 September 16th 05 07:28 PM


All times are GMT +1. The time now is 06:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"