Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I think the forum is a great idea, especially for those of us in consulting engineering. Keep up the good work!..."

Geography

Where in the world do Tek-Tips members come from?

Use data in a different worksheet to populate/replace data in anotherHelpful Member! 

huytonscouser (Programmer)
20 Jul 12 14:51
Hello, i have 2 worksheets 2 columns each.

I want to use the 1st column in one worksheet as the search criteria into the 2nd worksheet.
when i find a match(or not i'd want "not found") i want to insert into the original worksheet

i.e.

original worksheet(named Original) 2 columns
Task_Num Project Owning Division
1204.1 CORP - SMS
1907.8 CORP - SMS
1907.8 CORP - SMS
2030.1 CORP - SMS
2030.1 CORP - SMS
2030.1 CORP - SMS
2030.1 CORP - SMS


2nd worksheet (name Task Name Key)

Task Number Task Name
1001.0 Travel
1001.1 Expense
1200.2 Meetings/Calls
1202.1 Training Received
1202.2 Personal Development
1203.1 Internal Education
1203.2 Mentoring
1203.5 EMC Prov Prof
1204.1 Planned Absence
1204.2 Other Absence
1300.1 Presales Planning             


So in this example i'd like 1204.1 in the original to appear as
1204.1 Planned Absence
and not
1204.1 CORP - SMS



Is there a vlookup example someone could help me with ? If task_num is not found in Task Nme Key i'd like to display "Not found"

Helpful Member!  SkipVought (Programmer)
20 Jul 12 15:41
Hi,

I'm assuming Excel 2007+

=vlookup(a2,'2nd worksheet'!A:B,2,false)

assuming that your '2nd worksheet' is named 2nd worksheet

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

huytonscouser (Programmer)
20 Jul 12 16:54
Great, that works, thanks you very much.

How can i change the #N/A
to be a meaningful message ?

i.e.

=vlookup(a2,'2nd worksheet'!A:B,2,"not found in worksheet")

SkipVought (Programmer)
20 Jul 12 16:55

=iferror(vlookup(a2,'2nd worksheet'!A:B,2,false),"meaningful message")

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

huytonscouser (Programmer)
20 Jul 12 17:09
Excellent again ![bigears]

1st worksheet may be variable in length. It's created from a database query and the output is a .xlsx file.

When the document is opened, how can i be sure that ALL rows in the 1st worksheet are popuplated via the lookup formula. I'd like to just open the spreadsheet, and it magically has the correct data from the 2nd worksheet.

also, instead of a meaningful message when i don't find a match, can i just leave contents untouched ?

SkipVought (Programmer)
20 Jul 12 20:14
Just reference that cell rather than a literal.

To be sure that all rows are populated, convert the table with your formula, to a Structured Table, a REALLY GREAT NEW FEATURE in 2997+.

Insert > Tables > Table

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

huytonscouser (Programmer)
23 Jul 12 16:33
Thanks Skip 1st suggestion works fine to leave original data in place.

I don't undertsand 2nd part, could you kindly clarify.

Current formual is =IFERROR(VLOOKUP(A4,'Task Name Key'!A:B,2,FALSE),B5) this leaves data in place if a match is not found.

I drag this formula to all rows in worksheet, and i'm looking to make this task automated.
Thanks
SkipVought (Programmer)
23 Jul 12 16:37
If you make your table a Structured Table via Insert > Tables > Table, your formula will AUTOMATICALLY adjust to ALL ROWS in your Table. You don't have to fret about 'drag[ing] this formula to all rows in worksheet, and ... looking to make this task automated."

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close