Unique values from different sheet

sylbalm

New Member
Joined
Aug 17, 2007
Messages
5
Office Version
  1. 365
Platform
  1. MacOS
I have two sheets in my workbook, the first called "Fall" is courses listed by instructor, subject, and course #. The second, called "Dashboard" is a list of instructors who teach those courses, and I need it to automatically populate with the concatenated subjects and course #s from "Fall". It needs to list each course that each instructor teaches, across three columns, listing each course only once.

Fall Dashboard.jpg
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi sylbalm

Thanks for posting on the forum.

Try the following macro:
VBA Code:
Sub UniqueValues()
  Dim a As Variant
  Dim f As Range
  Dim i As Long, lr As Long, lc As Long
 
  a = Sheets("FALL").Range("A2", Sheets("FALL").Range("C" & Rows.Count).End(3)).Value
 
  With Sheets("DASHBOARD")
    .Range("A1").Value = "TTF"
    For i = 1 To UBound(a)
      Set f = .Range("A:A").Find(a(i, 1), , xlValues, xlWhole)
      If f Is Nothing Then
        lr = .Range("A" & Rows.Count).End(3).Row + 1
        .Range("A" & lr).Value = a(i, 1)
        .Range("B" & lr).Value = a(i, 2) & " " & a(i, 3)
      Else
        lc = .Cells(f.Row, Columns.Count).End(1).Column + 1
        .Cells(f.Row, lc).Value = a(i, 2) & " " & a(i, 3)
      End If
    Next
  End With
End Sub

Note:
You can update your settings, to know if you have office 365.

--------------
Let me know the result and I'll get back to you as soon as I can.
Cordially
Dante Amor
--------------​
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
If you're using 365, one way might be:

Book3
ABCD
3JoeAH 115AHH 233AHH 333
4SamAH 115
5SallyAHR 116
6LauraAHB 117AH 115
7DonaldAHB 117AHB 117
8ColinAHR 401
DASHBOARD
Cell Formulas
RangeFormula
A3:A8A3=UNIQUE(FALL!A2:A11)
B3:D3,B6:C7,B4:B5,B8B3=TRANSPOSE(FILTER(FALL!$B$2:$B$11,FALL!$A$2:$A$11=A3)&" "&FILTER(FALL!$C$2:$C$11,FALL!$A$2:$A$11=A3))
Dynamic array formulas.
 
Last edited:
Upvote 0
Another way in 365.

In cell A3 of the DASHBOARD sheet:
Excel Formula:
=UNIQUE(FALL!A2:A11)

In cells B3 to B8 of the DASHBOARD sheet:
Excel Formula:
=TRANSPOSE(FILTER(FALL!B2:B11&" "&FALL!C2:C11,FALL!A2:A11=A3))
 
Upvote 0
Solution
Another way in 365.

In cell A3 of the DASHBOARD sheet:
Excel Formula:
=UNIQUE(FALL!A2:A11)

In cells B3 to B8 of the DASHBOARD sheet:
Excel Formula:
=TRANSPOSE(FILTER(FALL!B2:B11&" "&FALL!C2:C11,FALL!A2:A11=A3))
That works great! I think I like this a little better than the VBA solution, which also works great. Thanks so much.
 
Upvote 0
Another way in 365.

In cell A3 of the DASHBOARD sheet:
Excel Formula:
=UNIQUE(FALL!A2:A11)

In cells B3 to B8 of the DASHBOARD sheet:
Excel Formula:
=TRANSPOSE(FILTER(FALL!B2:B11&" "&FALL!C2:C11,FALL!A2:A11=A3))
Another way in 365.

In cell A3 of the DASHBOARD sheet:
Excel Formula:
=UNIQUE(FALL!A2:A11)

In cells B3 to B8 of the DASHBOARD sheet:
Excel Formula:
=TRANSPOSE(FILTER(FALL!B2:B11&" "&FALL!C2:C11,FALL!A2:A11=A3))
Actually, let me ask you one more question about this -- I can't use the Unique formula is A3, since that's a fairly fixed list, and so if the transpose formula doesn't find a match for A3 (or A4,5,6, etc), it shows #CALC!. How can a make a null result show up as just an empty cell?
 
Upvote 0
How about this:

Code:
=TRANSPOSE(FILTER(FALL!B2:B11&" "&FALL!C2:C11,FALL!A2:A11=A3,""))
 
Upvote 0
How about
Excel Formula:
=TOROW(FILTER(FALL!B2:B11&" "&FALL!C2:C11,FALL!A2:A11=A3,""))
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,904
Members
449,194
Latest member
JayEggleton

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top