How to do I move data to fit an Excel 2003 spread sheet

I have created a list of all the possible IP numbers for our work network in a column in an excel spreadsheet.

Then I have the output from our DHCP server on another excel sheet, which has the IP, machine name, MAC address etc in separate columns all on the same row.

What I want to do is, using the IP address column from DHCP data as a way to make the assosciation or match, move the data to the corresponding row on the first excel sheet rather than doing it all manually.

Can anyone provide any insight into this? Is this possible with Excel or should I be using something else like Access?

Let me know if havn't explained clearly.

Who is Participating?
jppintoConnect With a Mentor Commented:
You can do that using a VLOOKUP() function like the one on the attached example.

Rory ArchibaldCommented:
Use a combination of INDEX and MATCH. Assuming IPs in col A on both sheets, then on the first sheet:
B2: =If(ISNA(MATCH(A2,Sheet2!A:A,0)),"",MATCH(A2,Sheet2!A:A,0))
C2: =IF($B2="","",INDEX(Sheet2!B:B,$B2))
and copy across for as many columns of data as you want returned. Then copy the formulas from row 2 down as far as required.


Using VBA macro will do this for you and copy the data across as well. I can't post the code right now but if you upload an example file I'll work on it later today.
The ONLY way to "move the data to the corresponding row on the first excel sheet rather than doing it all manually" as you requested is with a VBA macro... the VLOOKUP does not MOVE data just evaluate a formula.

Let me know if you still want the macro code...
defectaAuthor Commented:
Charltp5: Thats fine, this solution is more than sufficient. thanks anyway.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.