You are here:

Excel/Excel 2007 work on 2 sheets


QUESTION: I have one worksheet#1 with spare parts, numbers in col.1, end-user prices in col.G and purchase price in col.H.
On worksheet #2 I calculate the invoice to the customer: col.B is the part no, col.D is the end-user price and col.F is the purchase price.
I would like to do:
Worksheet #2 - i put the part number and want col.D (enduserprice) and co.F (purchase price) to appear automatically.
Could you please help?

ANSWER: Assume the name of worksheet#1 is  Sheet1

Say you enter a part number in B2, then
for row 2 in worksheet#2.  

D2:  =if($B2="","",vlookup($B2,Sheet1!$A:$H,7,False))
F2:  =if($B2="","",vlookup($B2,Sheet1!$A:$H,8,False))

then select D2 and drag fill down as far as you need to go.  Same for F2

Tom Ogilvy

[an error occurred while processing this directive]---------- FOLLOW-UP ----------

QUESTION: Wow, you are fast!!!
At mom no success, maybe because the spare part #s on Sheet 1 col.A are not in "number format" but text and also locked?


You are correct that "123" will not match to 123.

So if the part number on the Invoice sheet is stored as a number and the values in column A of Sheet1 are stored as text (my understanding of what you say), then you could try this

D2:  =if($B2="","",vlookup(Text($B2,"@"),Sheet1!$A:$H,7,False))
F2:  =if($B2="","",vlookup(Text($B2,"@"),Sheet1!$A:$H,8,False))

this will convert the number (stored as a number) in B2 to be a text string representing that number and then if the values in column A of sheet1 are matching text strings, the formulas should work.

Tom Ogilvy

---------- FOLLOW-UP ----------


QUESTION: Hmmm: still not. A changed the names of the sheets to "Sheet1...(I am workingg excel in German, no, i formatted the part number col.A on Sheet1 in text-not locked and on Sheet2 col.B same format. Here are screen shots of the two sheets.
Thank you for your patience (I have been trying to do this since years and spent hours and hours, but then - i am just no expert :-)


N632  is a text string.  It will never stored as a number.  So the vlookup should work.

A picture really doesn't tell me much beyond that.  If you want me to take a look at it, then send the sample workbook to   That is about all I can offer at this point.

Tom Ogilvy

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2017 All rights reserved.

[an error occurred while processing this directive]