table statistics

j3andc

Board Regular
Joined
Mar 4, 2002
Messages
168
Jim Test1.xls
ABCD
1
2ABC
31JimJoe
42JoeJim
53JeffMarkJim
64JoeMark
75Jeff
86MarkJeff
9
10
11Jim123
12Joe124
13Mark346
14Jeff356
Sheet1


From the above example, I am trying to use a formula to provide the statistics in rows 11 - 14 (by name, the number of each row that the name can be found). In its current layout, I can not figure out how to use a formula to do this.

Any help would be greatly appreciated.

Jim
 

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,005
Assuming that a name occurs only once in any row, try the following...

B11, copied across and down:

=IF(COLUMNS($B11:B11)<=COUNTIF($B$3:$D$8,$A11),SMALL(IF($B$3:$D$8=$A11,$A$3:$A$8),COLUMNS($B11:B11)),"")

...confirmed with CONTROL+SHIFT+ENTER, not just ENTER. Post back if a name can occur more than once in any row.

Hope this helps!
 

j3andc

Board Regular
Joined
Mar 4, 2002
Messages
168
Great! I was able to make it work.

Now to understand it.

What is the initial comparison for? (is the number of columns less than or equal to the number of times the name shows up?)
 

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,005
j3andc said:
What is the initial comparison for? (is the number of columns less than or equal to the number of times the name shows up?)
Yes, that's exactly the case. When COLUMNS($B11:B11) returns a number that is greater than the number of times the name shows up, the formula returns a blank instead of #NUM!, which would otherwise occur without the IF statement.
 

Forum statistics

Threads
1,081,832
Messages
5,361,586
Members
400,639
Latest member
fleyd

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top