View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jac007 jac007 is offline
external usenet poster
 
Posts: 11
Default Which Function do I use?

Thanks! That worked fine, the only problem that i'm having with it is that it
only returns the first 4 rows. (Ex. profile 1 brings the first 4 users it
finds, it doesn't bring others). Profile 1 is in A2 and A3 And A4, so the
users are in B2, C2, D2, B3, C3, D3, B4, C4, and D4. So it only brings back
B2, C2, and D2. Not B3 and so on.

"Harlan Grove" wrote:

jac007 wrote...
I get an error of "few arguments". . . .


Sorry, it should be

Sheet1!B2:
=REPT("X",COUNTIF(INDEX(GUTable,MATCH(B$1,INDEX(GU Table,0,1),0),0),$A2))

Omitted the 2nd ,0) .

. . . I don't understand why you put the B$2 in the match function and $A2
in the countif function. What are those suppose to represent?


The B$2 in my original formula was a mistake. It should have been B$1,
which would be the group name in the 1st row. $A2 would be the user
name in the 1st column. That's what you said would be in row 1 (groups
in B1:Z1) and column A (users in A2:A256) in Sheet1. Cell B2 in Sheet1
would presumably need to reference the group in the same column, so
cell B1 with row absolute - B$1, and the user in the same row, so cell
A2 with column absolute - $A2.

Picking this apart, MATCH(B$1,INDEX(GUTable,0,1),0) returns the row
index of the 1st match for the group in B1 in the 1st column of
GUTable. INDEX(GUTable,MATCH(..),0) return the entire row in GUTable
corresponding to that match. COUNTIF(INDEX(..),$A2) counts the number
instances the user in A2 appears in that row in GUTable. Presumably no
user would appear more than once in any row in GUTable, so the COUNTIF
call would return 0 or 1. The REPT("X",COUNTIF(..)) call then returns
"X" if the user in A2 appears in the first row in GUTable corresponding
to the group in B1 and "" (nothing) otherwise.