Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two Excel worksheets in the same file.

One is a full list of Parents and their associated children.

The other is a list of Parents and their platform logins.

For some reason, I have a discrepancy in length between the two files - i.e. there is 570 users in one file and 599 in the other.

What I'd like to do is - presumably using VLOOKUP - display the parents' passwords if their usernames match on both sheets.

Sheet one (called ParentChildren)

ParentUniqueID ParentTitle ParentForename ParentSurname ParentUsername Password ChildForename ChildSurname ChildYeargroup ChildRegGroup ChildUniqueID

Sheet two (called ParentLogins)

Surname Forename Login Profile UID Username Password

What I'd like to do...

If ParentUsername in !ParentChildren matches Username in !ParentLogins, fill the Password field on !ParentChildren (which is currently empty) with the data from the corresponding Password field on !ParentLogins.

If a row doesn't match - i.e. there's a username which exists in !ParentChildren but not !ParentLogins, I'd like that row's Password field in !ParentChildren to remain empty.

Hope that makes sense - think I've somewhat confused myself!

Thanks in advance,

share|improve this question
Have you tried VLOOPKUP yet? What results did you get, if any? – mtone Aug 30 '12 at 10:49
I haven't, no. I can't get my head round I'd use a VLOOKUP in this context. – dunc Aug 30 '12 at 11:05

Formulas are much easier to write if the data is in a table (Excel 2007 and later) so I've written the formula like that.

So the Password cell in ParentChildren would be the formula:

=IFERROR(VLOOKUP([@ParentUsername], ParentLogins, 6, FALSE), "")

Give that a shot and let me know if it does what you're looking for. This assumes you're using Excel 2007 or higher, if you're not let me know as it's not too hard to tweak the formula.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .