List/highlight differences after comparing two groups of set data.

xlbeginnerxl

New Member
Joined
Jul 16, 2013
Messages
8
Hi,

My excel's worksheet layout is similar to the table below, but with 7000+rows. The only entity that is unique is the email address (Col A). The table below shows employees who have multiple mobile devices and whether they have installed Mobile Device Management (MDM) on each of their mobile devices.

I'd like to know how can I do the following:
  • compare columns (E to K) with columns (M to S), and then list out the differences in columns (T-Z) as well as highlight the missing values in columns (E to K)?

Any help on this would be much appreciated.

ABCDEFGHIJKLMNOPQRSTUVWXYZ
EmailNameLocationTotal DevicesDevice1Device2Device3Device4Device5Device6Device7Number of devices MDM installed onMDM on Device1MDM on Device2MDM onDevice3MDM on Device4MDM on Device 5MDM on Device6MDM on Device 7To Install on 1To Install n 2To install on 3To Install on 4To Install on 5To Install on 6To Install on 7
abc@xyz.comabcLondon3iPad Air 2iPhone 6s PlusAndroid2iPhone 6s PlusiPad Air 2Android
cde@xyz.comcdeNew York4iPhone 4siPhone 6iPad MiniAndroid2AndroidiPad MiniiPhone 4siPhone 6
fgh@xyz.comfghDublin2iPhone 6iPad Air0iPhone 6iPad Air

<tbody>
</tbody>


















Many thanks

PS: I've tried using formula conditional formatting rule:
  • =COUNTIF($m$2:$s$2,$e2)=0 for =$e$2:$e$4398
  • =COUNTIF($m$2:$s$2,$f2)=0 for =$f$2:$f$4398 & etc
but, it doesn't seem to work very well.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try this array formula in T2
=IFERROR(INDEX($E2:$K2,SMALL(IF($E2:$K2<>"",IF(ISNA(MATCH($E2:$K2,$M2:$S2,0)),COLUMN($E2:$K2)-COLUMN($E2)+1)),COLUMNS($E2:E2))),"")

confirmed with Ctrl+Shift+Enter, not just Enter

Copy (drag) across till Z2 and down

Hope this helps

M.
 
Upvote 0
To highlight

Select E2:Kn (where n is the last row with data)

Use this formula in Conditional Formatting

=COUNTIF($M2:$S2,E2)=0

pick the format you want

M.
 
Upvote 0
VBA approach:
Code:
Sub CompareLists()
    Application.ScreenUpdating = False
    Dim Rng As Range, RngList As Object
    Dim LastRow As Long
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    Dim email As Range
    Dim x As Long
    x = 20
    For Each email In Range("A2:A" & LastRow)
        Set RngList = CreateObject("Scripting.Dictionary")
        For Each Rng In Range("M" & email.Row & ":S" & email.Row)
            If Not RngList.Exists(Rng.Value) Then
              RngList.Add Rng.Value, Nothing
            End If
        Next
        For Each Rng In Range("E" & email.Row & ":K" & email.Row)
            If Not RngList.Exists(Rng.Value) Then
              Rng.Font.ColorIndex = 3
              Cells(email.Row, x) = Rng
              x = x + 1
            End If
        Next
        RngList.RemoveAll
        x = 20
    Next email
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Another option:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG15Dec11
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range, n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Dic [COLOR="Navy"]As[/COLOR] Object
[COLOR="Navy"]Dim[/COLOR] Ac [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer,[/COLOR] K [COLOR="Navy"]As[/COLOR] Variant
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
[COLOR="Navy"]Set[/COLOR] Dic = CreateObject("scripting.dictionary")
Dic.CompareMode = vbTextCompare
    [COLOR="Navy"]For[/COLOR] Ac = 5 To 19
        [COLOR="Navy"]If[/COLOR] Not Ac = 12 [COLOR="Navy"]Then[/COLOR]
            [COLOR="Navy"]If[/COLOR] Not Dic.Exists(Dn(, Ac).Value) [COLOR="Navy"]Then[/COLOR]
                Dic.Add Dn(, Ac).Value, Dn(, Ac)
            [COLOR="Navy"]Else[/COLOR]
                Dic.Remove (Dn(, Ac).Value)
            [COLOR="Navy"]End[/COLOR] If
        [COLOR="Navy"]End[/COLOR] If
    [COLOR="Navy"]Next[/COLOR] Ac
[COLOR="Navy"]If[/COLOR] Dic.Count > 0 [COLOR="Navy"]Then[/COLOR]
    Dn(, 20).Resize(, Dic.Count) = Dic.keys
    [COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] K [COLOR="Navy"]In[/COLOR] Dic.keys
        Dic(K).Font.Color = vbRed
    [COLOR="Navy"]Next[/COLOR] K
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
Members
449,093
Latest member
Mnur

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