You are here:

# Excel/Insert Rates using formula

Question

Excel file
Sir,

please see the image alongside and tell me how to write a formula to insert rates from sheet2 in sheet1.

Thanks

nabam vlookup
Nabam,

I used the shaded data you show in you image.  I placed it in the same location in sheet1 except that the orange shaded area was where I placed this formula:

=IF(ISNUMBER(SEARCH("x",G6)),VLOOKUP(LEFT(G6,SEARCH("x",G6)-1)&"mm dia",OFFSET(Sheet2!\$B\$1,MATCH(\$G\$5,Sheet2!\$B:\$B,0)-1,0,20,2),2,FALSE),VLOOKUP(G6,OFFSET(Sheet2!\$B\$1,MATCH(\$G\$5,Sheet2!\$B:\$B,0)-1,0,20,2),2,FALSE))

this formula was copied from cell H6.  Now since it has to refer to the type of hardware in cell G5, it can only be copied down within that hardware section. It can be copied to the other sections but the reference in the formula to what cell to find the hardware information would need to be adjusted.  I doubt you are using this table in sheet1 but perhaps have a row by row entry where you will have the hardware type and diameter listed.  You can adjust my formula to reference those cells.

I have adapted the formula to handle entries with the "x" and with entries that match what is in column B of the lookup table.

I don't know how many diameters you could have under each hardware item.  I have allowed for 20 in the formula.  If you could have more, then you will need to adjust for this.  Also, when you have fewer than 20, this may include data from another hardware item from Sheet2, but that should not cause a problem as long as you are looking up a diameter for your hardware that is listed in sheet2.

Also, you show two separate listings for the same hardware.  By using 20 as the number of diameters, I capture all this data, but I would expect that you table would really only have one section for each unique hardware identity.

I have attached an image of my result.

--
Regards,
Tom Ogilvy
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

#### Tom Ogilvy

##### Expertise

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.]

##### Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.