LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Harlan,

Yeah, I figured that myself afterwards. Worked at start and with OPs data,
but fell apart when I tried to make it generic to save in the library - by
which time, Domenic had posted.

Bob


"Harlan Grove" wrote in message
oups.com...
Bob Phillips wrote...
How about

=SUMPRODUCT(((B2:B20=16)*(C2:C20="BRY")*(A2:A20< ""))
/COUNTIF(A2:A20,A2:A20&""))

...

Doesn't work. OP's sample data was too easy - no variation in criteria
fields. Using the OP's sample data, and adjusting your formula to refer
to rows 2 to 12, change the first Week# field for EE ID 100015 to 22.
Your formula then returns 6.667, which is a clear error (counts are
always integers).

The problem is that you can't use COUNTIF in the denominator because
it'll count *ALL* instances of each value in A2:A12.

You gotta get tricky, and the OP was closer than he (or you) thought.

=COUNT(1/FREQUENCY((B2:B12=16)*(C2:C12="BRY")*MATCH(A2:A12, A2:A12,0),
ROW(INDIRECT("1:"&ROWS(B2:B12)))-1))
-(SUMPRODUCT((A1:A12=A15)*(C1:C12=B15)-1)0)

The trick is putting the criteria *inside* the FREQUENCY call.
Subtracting 1 from ROW()'s result creates a 0 bin for the records that
don't satisfy the criteria. The final SUMPRODUCT term excludes the 0
bin if there are any records that don't satisfy the criteria. Also note
that this doesn't have to be entered as an array formula.



 
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
filtering for unique records KG Excel Discussion (Misc queries) 7 August 13th 05 06:07 PM
Counting occurrences of multiple conditions Jvanderv1 Excel Discussion (Misc queries) 2 April 6th 05 01:07 AM
SUM based on multiple conditions - SORRY, URGENT!!! marika1981 Excel Worksheet Functions 4 February 18th 05 11:13 AM
Counting unique entries in column A but only if specific values appear in columns B and C markx Excel Worksheet Functions 1 February 10th 05 11:52 AM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM


All times are GMT +1. The time now is 08:29 AM.

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

About Us

"It's about Microsoft Excel"