Lookup of MAC addresses

Eyez01

New Member
Joined
Sep 2, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I have a spread sheet of MAC addresses and I'm trying to use a VLookup to search for a MAC address value and return values from hostname, OS and whether the device is virtual or not. At first I kept getting a N/A so then turned to trying to use INDEX & MATCH but still can't get it to work. Does anyone have any suggestions?

MAC Address 1MAC Address 2MAC Address 3MAC Address 4MAC Address 5Host NameOSVirtual
00:11:22:33:44:5500:11:22:33:44:5a00:11:22:33:44:5b00:11:22:33:44:5d00:11:22:33:44:5cPDC001WindowsYes
ab:11:22:33:44:55ff:11:22:33:44:5arr:11:22:33:44:5bht:11:22:33:44:5dAPPINT001AIXNo
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Book1
BCDEFGHIJK
2Inset HereHost NameOSVirtual
300:11:22:33:44:5cPDC001WindowsYesMAC AddressHost NameOSVirtual
400:11:22:33:44:55PDC001WindowsYes
500:11:22:33:44:5aPDC001WindowsYes
600:11:22:33:44:5bPDC001WindowsYes
700:11:22:33:44:5dPDC001WindowsYes
800:11:22:33:44:5cPDC001WindowsYes
9ab:11:22:33:44:55APPINT001AIXNo
10ff:11:22:33:44:5aAPPINT001AIXNo
11rr:11:22:33:44:5bAPPINT001AIXNo
12ht:11:22:33:44:5dAPPINT001AIXNo
Sheet1
Cell Formulas
RangeFormula
C3C3=VLOOKUP($B3,$H:$K,2,0)
D3D3=VLOOKUP($B3,$H:$K,3,0)
E3E3=VLOOKUP($B3,$H:$K,4,0)
 
Upvote 0
Welcome to the MrExcel board!

Keeping your existing layout, and assuming addresses do not appear more than once in the table, try ..

21 09 03.xlsm
ABCDEFGH
1MAC Address 1MAC Address 2MAC Address 3MAC Address 4MAC Address 5Host NameOSVirtual
200:11:22:33:44:5500:11:22:33:44:5a00:11:22:33:44:5b00:11:22:33:44:5d00:11:22:33:44:5cPDC001WindowsYes
3ab:11:22:33:44:55ff:11:22:33:44:5arr:11:22:33:44:5bht:11:22:33:44:5dAPPINT001AIXNo
4
5
6
7Mac AddressHost NameOSVirtual
800:11:22:33:44:5bPDC001WindowsYes
900:11:22:33:44:55PDC001WindowsYes
10ht:11:22:33:44:5dAPPINT001AIXNo
Mac Address Details
Cell Formulas
RangeFormula
B8:D10B8=INDEX(F:F,SUMPRODUCT(ROW($A$2:$E$3)*($A$2:$E$3=$A8)))
 
Upvote 0
Hi @earthworm. Thank you for the response. I wanted to avoid having to format the data as the data set I'm working with is quite large.

Hi @Peter_SSs that is brilliant. Could you explain a little about the formula that you have used to do this. Rather than just using it I want to understand a bit more so I can take the learn away :) Thanks
 
Upvote 0
Glad it worked for you. :)

Could you explain a little about the formula that you have used to do this.
Hmm, not that easy to explain, but let's try. Take the formula in B8 in my mini-sheet
=INDEX(F:F,SUMPRODUCT(ROW($A$2:$E$3)*($A$2:$E$3=$A8)))
So, we are going to retrieve a value from column F: =INDEX(F:F, ...

SUMPRODUCT(ROW($A$2:$E$3)*($A$2:$E$3=$A8))

ROW($A$2:$E$3) = {2,3}

The Mac address in A8 is the same as the one in C2 so ($A$2:$E$3=$A8) evaluates to the array {FALSE,FALSE,TRUE,FALSE,FALSE;FALSE,FALSE,FALSE,FALSE,FALSE}

So SUMPRODUCT({2,3}*{FALSE,FALSE,TRUE,FALSE,FALSE;FALSE,FALSE,FALSE,FALSE,FALSE}) produces
SUM{0,0,2,0,0;0,0,0,0,0}
which sums to 2

Therefore we get INDEX(F:F,2) = PDC001
 
Upvote 0
I've been testing this a little more and have a found that if the MAC address cannot be matched, the formula returns values of servers at the start of the list. Is there a way to say if the MAC address is not found, return a value, e.g. N/A?
 
Upvote 0
assuming addresses do not appear more than once in the table,
Still with the above assumption, try

21 09 03.xlsm
ABCDEFGH
1MAC Address 1MAC Address 2MAC Address 3MAC Address 4MAC Address 5Host NameOSVirtual
200:11:22:33:44:5500:11:22:33:44:5a00:11:22:33:44:5b00:11:22:33:44:5d00:11:22:33:44:5cPDC001WindowsYes
3ab:11:22:33:44:55ff:11:22:33:44:5arr:11:22:33:44:5bht:11:22:33:44:5dAPPINT001AIXNo
4
5
6
7Mac AddressHost NameOSVirtual
800:11:22:33:44:5bPDC001WindowsYes
900:11:22:33:44:55PDC001WindowsYes
10ht:11:22:33:44:5dAPPINT001AIXNo
11abc-def-ghiN/AN/AN/A
1200:11:22:33:44:5cPDC001WindowsYes
Mac Address Details
Cell Formulas
RangeFormula
B8:D12B8=IF(COUNTIF($A$2:$E$3,$A8),INDEX(F:F,SUMPRODUCT(ROW($A$2:$E$3)*($A$2:$E$3=$A8))),"N/A")
 
Upvote 0

Forum statistics

Threads
1,215,488
Messages
6,125,092
Members
449,206
Latest member
ralemanygarcia

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