• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

Excel Vlookup return a formula relative to current sheet

Hi Experts.

Consider this scenario.

A vlookup on Sheet1 returns a value from Sheet2.  The cell it successfully finds and returns on Sheet2 is this formula    =E1&” is good”

I want the vlookup to display that on Sheet1 and the formula to look at E1 on Sheet1.  Currently it’s still referring to E1 on Sheet2.

Obviously if the formula on Sheet2 was  =Sheet1!E1&" is good"  then the result of vlookup would work but I want to use Sheet2 to be accessed from multiple sheets.  Therefore Sheet2 must stay generic and refer to E1 and the other sheets will each have the correct value in their own E1.

A simple example is attached.  

How do I achieve this?  I hope my question is clear.

Thanks,

Will

vlookup-help.xlsx
0
willnjen
Asked:
willnjen
  • 5
  • 3
  • 2
  • +1
1 Solution
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

Sorry, I'm confused. What do you want where?

On Sheet1 you look up a value from Sheet2. So far so good.

Do you want in Sheet1, B1

=E1&VLOOKUP(A1,Sheet2!A1:B3,2)

Can you post a sample with several sheets and the desired results in each sheet?

cheers, teylyn
0
 
dlmilleCommented:
My two cents.

I don't think you need the reference to E1 in Sheet2.  You just need the factor (e.g., 1,2,3) and the results of that factor (e.g., good, average, bad)

Then, from any other sheet in the workbook, you can use the formula (example below pasted in A1, having a name in E1:

=E1 & VLOOKUP(A1,Sheet2!$A$1:$B$3,2,0)

Thus, the name in E1 is the first, then the result of looking up A1 in the table Sheet2!A1:B3, returning column 2 with exact match 0.

You can copy this formula pretty much anywhere, where Vlookup(A1 <- that points to the factor of 1,2,3 and E1 <- that points to the person's name.

I hope I'm adding clarity here.

See example spreadsheet where I made slight changes, and added another sheet tab with names and factors/ratings, so you can see it play out.

Cheers,

Dave
vlookup-help.xlsx
0
 
willnjenAuthor Commented:
Hi Teylyn

Have a look at the file vlookup-help2.xlsx attached to this answer.  There are two sheets in the file.

Cheers,

Will  vlookup-help2.xlsx
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
willnjenAuthor Commented:
Hi Dlmille

Sorry, I think I've simplied my example too much.  In reality, the cell returned by the vlookup will be something like....

"Jim is good. He is able to do stuff.  Jim is always working hard".  

That will be a formula like

=E1&" is good. "&E2&" is able to do stuff. "&E1&" is always working hard"

E2 will be a He/She if Jim is a boy or girl.

All that info of name and boy/girl will be on Sheet1.  The formula found by the lookup needs to refer to the info in sheet1.  Sheet1 will be duplicated 30 times with all sheets vlookuping Sheet2.
0
 
willnjenAuthor Commented:
in plain english, the formula on sheet2 needs to be...
=E1 from the current sheet & " is good."

Then when the vlookup formula on sheet one displays that formula above, the E1 gets it's value from the current sheet1.

Sorry, late in the day here in New Zealand so hope I'm being clear.

Cheers,

Will
0
 
dlmilleCommented:
I agree with teylyn, a more thorough working example (without formulas, if need be) with guidance on what you're trying to do is indeed in order.

You will undoubtedly need to create these lists of he/she's, actions (working hard, able to do stuff, etc.) and decide how you want to leverage them (re: put them all together).

Give it some thought and "paint a picture" and I'm sure teylyn, another E-E expert, or myself will be more than happy to get this over the line.  Please create several examples to get your thought across.

Cheers,

Dave
0
 
Rory ArchibaldCommented:
It appears to me that you are basically trying to return and evaluate a formula string. Although this can be done (see attached file for one way; you could also use code) to me it implies a bad workbook design. I suspect that you ought to be using a template sheet instead or something along the lines of what Dave has suggested.

Regards,
Rory
vlookup-help.xlsm
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Will, I'm in New Zealand, too, so I feel the same drain pain of the day.

In your last sample you say


I want the result of the vlookup in B2 to reference E1 on this sheet.
The basic vlookup is working but the current result is looking at E1 on Sheet2.


I don't see how the "current result" of the vlookup is looking at E1 on Sheet 2 at all. There is no value in E1 on Sheet2.

In fact, the formula that I posted in my first comment will take E1 of the current sheet and combine it with the vlookup formula. Dave refined that formula to include only an exact match. The result is

=E1&VLOOKUP(A1,Sheet2!A1:B3,2,0)

Jim is good

If that's not what you want, you'll need to explain with more data and more details.

cheers, teylyn

0
 
willnjenAuthor Commented:
Hi Guys

Sorry if I'm not being clear.

See the more detailed spreadsheet attached called vlookup-help3.xlsx.

It has examples of what I wanted to achieve.

Cheers,

Will vlookup-help3.xlsx
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

In the Master sheet, replace the text with this:


StudentName is good. StudentParticiple is working well in class. StudentName is good at Excel formulas.
StudentName is average
StudentName is bad

In the Student sheets, use this as the formula in column B, starting in B1

=SUBSTITUTE(SUBSTITUTE(VLOOKUP(A1,Master!$A$1:$B$3,2),"StudentName",$E$1),"StudentParticiple",$E$2)

see attached.

cheers, teylyn
vlookup-help3.xlsx
0
 
willnjenAuthor Commented:
Oooooh, now that is classy!!!  Using SUBSTITUTE makes my Master sheet much nicer and it keeps all the formula on the individual student's sheet.

Thanks so much!  It's exactly what I was trying to achieve.

Cheers,

Will
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now