Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Combinations for Members in Meetings.

Combinations for Members in Meetings

Written by Allen Wyatt (last updated May 17, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


Bob has a worksheet that has member names down the left side and months of the year across the top. In each cell of the grid he enters the dates on which meetings occur that were attended by the member. Bob is looking for a way to tell at a glance who has not met with whom.

There are several ways that a solution to this problem can be approached. If your table design is flexible, you can "simplify" things by changing the way your table is laid out. Instead of putting months across the columns, you can simply have each column be a meeting date. Then, each cell could contain some sort of indicator (a number or a character) that indicates the person attended the meeting on that particular date. It would be a relatively easy process to figure out who had not met with whom:

  1. Choose the key member, the one you want to check, and move him/her to the top of your data table.
  2. Sort the data table horizontally on the key member row, so all the meetings that the key member attended are in the left-most columns.
  3. Sort everyone except the key member vertically on the first three meeting dates. Everyone who met the key member in those three meetings is now at the top of the data table, just below the key member.
  4. Move down the data table and select everyone who has not yet met the key member and sort on the next three meeting dates.
  5. Repeat steps 3 and 4 until all meeting dates have been sorted.
  6. Everyone remaining at the bottom of the data table (those not selected in steps 3 and 4) has never met the key member.

If you cannot change the format of your table, then a macro solution is called for. There are many approaches that could be used in a macro, but the following is perhaps the most direct:

Sub PeopleNotMet()
    Dim rTable As Range
    Dim rOutput As Range
    Dim iCols As Integer
    Dim iCol As Integer
    Dim iRows As Integer
    Dim iRow As Integer
    Dim iCompRow As Integer
    Dim sNotMet As String
    Dim sMet As String

    Set rTable = Worksheets("Sheet1").Range("A1").CurrentRegion
    Set rOutput = Worksheets("Sheet2").Range("a1")
    sNotMet = "X"
    sMet = ""

    Application.ScreenUpdating = False
    With rTable
        iRows = .Rows.Count
        iCols = .Columns.Count
        
        .Columns(1).Copy
        With rOutput
            .PasteSpecial
            .PasteSpecial Transpose:=True
            Application.CutCopyMode = False
            Range(.Offset(1, 1), .Offset(iRows - 1, _
              iRows - 1)).Value = sNotMet
            Range(.Offset(1, 1), .Offset(iRows - 1, _
              iRows - 1)).HorizontalAlignment = xlCenter
        End With
    End With
    With rTable.Cells(1)
        For iRow = 1 To iRows - 1
            For iCol = 1 To iCols - 1
                For iCompRow = 1 To iRows - 1
                    If Not (IsEmpty(.Offset(iRow, iCol))) Then
                        If Not (IsEmpty(.Offset(iCompRow, iCol))) Then
                            If .Offset(iRow, iCol).Value = _
                              .Offset(iCompRow, iCol).Value Then _
                              rOutput.Offset(iRow, iCompRow).Value = sMet
                        End If
                    End If
                Next
            Next
        Next
    End With

    Set rTable = Nothing
    Set rOutput = Nothing
    Application.ScreenUpdating = True
End Sub

This macro assumes a couple of things. First, it assumes that Bob's original data table is on Sheet1, starting in cell A1. Second, it assumes that the "who has not met with whom" table should be on Sheet2, beginning at cell A1. If these assumptions are correct, then when you run the macro, the table created on Sheet2 shows names down the left side and names across the top. The intersecting cells will contain either nothing (which means that the people have met) or a capital X (which means they have not met).

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2304) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Combinations for Members in Meetings.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Selecting a Field

Do you need to select a field? It is as simple as selecting a single character, as this tip explains.

Discover More

Hiding Gridlines

For those times when you remove the borders from your tables, Word provides a way that you can display non-printing ...

Discover More

Updating Links

When you establish links between data on a target worksheet and data on a source worksheet, those links are typically ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (menu)

Selecting the First Cell In a Row

When creating macros, you'll often have a need to select different cells in the worksheet. Here's how to select the first ...

Discover More

Relative VBA Selections

Need to select a cell using a macro? Need that selection to be relative to the cell you currently have selected? Here's ...

Discover More

Easily Adding Blank Rows

Want to add a bunch of blank rows to a your data and have those rows interspersed among your existing rows? Here's a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.