I have a spreadsheet which tracks users and the groups they belong to. Normally, I need to go user by user, group by group to find the match and place an “X” in that cell. It’s long and tedious, so I’m hoping someone may have a better solution.
Here’s what my spreadsheet looks like:
I can get a list of all users in each group (SharePoint) but I need to track this information in Excel. I’m thinking something like this would be start: =if((A2=”user1″,”user2″,”user5″,”userN”),”X”,””)
I’m not sure if this formula would work but that’s kind of the logic I have behind it. I’d like to find a way where I can easily and quickly switch the names because it’s a long list.
Okay, I hope I understood your issues.
Copy and paste the users in a separate sheet in the workbook (say
Sheet2), so that for Group1, you have a single cell, example:
A Mike Stuart, Casey Jones, Jessica Milne
On the data tab, you can use
Text to Column >
Comma to get this:
A B C Mike Stuart | Casey Jones | Jessica Milne
Meaning, you have one user in one column. Preferably, all the group 1 users should be in this row.
In your sheet with users and groups, you then use the formula in cell B2 and drag it down:
=IF(ISNA(HLOOKUP(A2, Sheet2!$1:$1, 1, 0)), "", "X")
You can put the other groups below the first group, so that row 2 of
Sheet2 has all the users in group2, row 3 in
Sheet2 has all the users in group 3, etc.
For group 2, you’ll use:
=IF(ISNA(HLOOKUP(A2, Sheet2!$2:$2, 1, 0)), "", "X") ^ ^
^ show what I have changed.
HLOOKUP works as follows:
HLOOKUP(lookup_value, table_array, row_index, [range_lookup])
lookup_value is the value you’re looking for, here each user in your final sheet.
table_array is the table in which the formula looks for. Here, it’s
$1:$1, so that the formula looks for the
lookup_value in Row 1 of
row_index is 1 because we’re looking in one row only. You can make some research as to how to use it if you want.
[range_lookup] is optional, but defaults to approximate match, which is not what you generally want. Put
0 there to mean “exact match”.
Using pivot tables he’s an example of what could be done.