threestacks
New Member
- Joined
- Nov 24, 2014
- Messages
- 2
I am trying to write a function that will count all unique values in an array that are associated with a value. For example, I want a function that will:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Molly[/TD]
[TD]Matt[/TD]
[TD]Russ[/TD]
[TD]David[/TD]
[TD]Dan[/TD]
[TD]Erica[/TD]
[TD]James[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Frank[/TD]
[TD]Jen[/TD]
[TD]Liz[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Matt[/TD]
[TD]Gabi[/TD]
[TD]Andrei[/TD]
[TD]Jorge[/TD]
[TD]Phil[/TD]
[TD]Meghan[/TD]
[TD]Harvey[/TD]
[/TR]
[TR]
[TD]Molly[/TD]
[TD]Jose[/TD]
[TD]Steve[/TD]
[TD]Chris[/TD]
[TD]Dan[/TD]
[TD]George[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jake[/TD]
[TD]Steph[/TD]
[TD]Ellen[/TD]
[TD]Andrew[/TD]
[TD]Nick[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Has anyone done this before that might be able to help? Thanks!
- go to column 1 (first column all the way to the left)
- If the value in column 1 = Molly, the function will count all unique values in columns 2:7, but only the values from the rows that are associated with Molly's name (here it would be rows 1 and 4)
- In this case, it would count Matt, Russ, David, Dan, Erica, James, Jose, Steve, Chris, and George
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Molly[/TD]
[TD]Matt[/TD]
[TD]Russ[/TD]
[TD]David[/TD]
[TD]Dan[/TD]
[TD]Erica[/TD]
[TD]James[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Frank[/TD]
[TD]Jen[/TD]
[TD]Liz[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Matt[/TD]
[TD]Gabi[/TD]
[TD]Andrei[/TD]
[TD]Jorge[/TD]
[TD]Phil[/TD]
[TD]Meghan[/TD]
[TD]Harvey[/TD]
[/TR]
[TR]
[TD]Molly[/TD]
[TD]Jose[/TD]
[TD]Steve[/TD]
[TD]Chris[/TD]
[TD]Dan[/TD]
[TD]George[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jake[/TD]
[TD]Steph[/TD]
[TD]Ellen[/TD]
[TD]Andrew[/TD]
[TD]Nick[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Has anyone done this before that might be able to help? Thanks!