Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.