+ Reply to Thread
Results 1 to 7 of 7

VLOOKUP/INDEX MATCH formula for finding cost of toner based on printer name & model

  1. #1
    Registered User
    Join Date
    06-27-2011
    Location
    Springfield, Missouri
    MS-Off Ver
    Excel 2016
    Posts
    16

    VLOOKUP/INDEX MATCH formula for finding cost of toner based on printer name & model

    I have two Excel workbooks: Printers.xlsx and Template.xlsx

    In Printers.xlsx I have a tab titled Inventory with the following columns in this order: Printer Name, Model #

    In Printers.xlsx there is another tab titled Toner with the following columns in this order: Model #, Toner Part #, Toner Cost

    In Template.xlsx I have a tab titled Data Table with the following columns in this order: Printer Name, Toner Part #, Toner Cost

    The column Printer Name is filled with data, but I am trying to setup Toner Part # and Toner Cost and need help.

    I need to write a formula that makes intelligent use of [@[Column Name]], [Column Name], and other methods that I might not know about so as not to restrict the formulas application to a specific range within the table (example A2:A198) but to the table/column so that when other Technicians use ths workbook it is maintenance-free in terms of its functionality and hard to mess up if moving columns around.

    Toner Part # -- It needs to take [@[Printer Name]] and find the matching Printer Name value in Printers.xlsx Inventory tab. When it finds a match, it needs to look over to the value in [Model #] of the same row, then find a match in the Toner tab of the same Excel workbook. Once it finds its match, it needs to retrieve the value of [Toner Part #].

    Toner Cost -- Uses same formula as Toner Part # but retrieve value [Toner Cost] instead of [Toner Part #]

    Basically the formula looks up the printer in the Inventory to find out what model it is, then uses the model to determine what toner cartridge belongs to this printer and retrieves the cost of the toner cartridge (aka Toner Cost column).

    If someone would put together a finished formula for me, I will analyze the formula to try understand how it is constructed and how it works and I will ask questions 'why' where I don't understand because I really do want to understand. I've a headache with trying to understand or construct a VLOOKUP() or INDEX() and MATCH() and IF().

    Getting past this obstacle would make a huge and wonderful difference to me way beyond just this scenario.

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: VLOOKUP/INDEX MATCH formula for finding cost of toner based on printer name & model

    Could you send a sample workbook.. It certainly can be done

  3. #3
    Registered User
    Join Date
    06-27-2011
    Location
    Springfield, Missouri
    MS-Off Ver
    Excel 2016
    Posts
    16

    Re: VLOOKUP/INDEX MATCH formula for finding cost of toner based on printer name & model

    Attached:

    Example_Printers.xlsx

    Example_Template.xlsx

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: VLOOKUP/INDEX MATCH formula for finding cost of toner based on printer name & model

    Use this formula in B1
    =VLOOKUP(VLOOKUP(Table1[[#This Row],[Printer Name]],Example_Printers.xlsx!Table1[#Data],2,FALSE),Example_Printers.xlsx!Table2[#Data],COLUMN(),FALSE)
    Copy to B1:C8
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  5. #5
    Registered User
    Join Date
    06-27-2011
    Location
    Springfield, Missouri
    MS-Off Ver
    Excel 2016
    Posts
    16

    Re: VLOOKUP/INDEX MATCH formula for finding cost of toner based on printer name & model

    What does it mean when you do [[#This Row]]? I know that [nameOfColumnHere] points to data in a column, and [@[nameOfColumnHere]] means to use the value in the current row in specified column

  6. #6
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: VLOOKUP/INDEX MATCH formula for finding cost of toner based on printer name & model

    Table1[[#This Row],[Printer Name]]
    This means the value from the row where formula is placed under the column head Printer Name

  7. #7
    Registered User
    Join Date
    06-27-2011
    Location
    Springfield, Missouri
    MS-Off Ver
    Excel 2016
    Posts
    16

    Re: VLOOKUP/INDEX MATCH formula for finding cost of toner based on printer name & model

    OK, so here I decipher the formula starting with the nested VLOOKUP.

    =VLOOKUP([@[Printer Name]],Example_Printers.xlsx!Table1[#Data],2,FALSE)
    This says that we want, in example, DFW_LZ.P59 (because that is the current row's value for Printer Name). So it will look in Example_Printers.xlsx Table1 for DFW_LZ.P59, and because of #Data it will search the entire table. Once it finds DFW_LZ.P59, we want COLUMN NUMBER TWO (we specified it as the third parameter col_index_num in the VLOOKUP). We also say it has to be an exact match.

    So, this VLOOKUP's result is the Model # of the printer (which happens to be "HP LaserJet 400 M401dn")

    Now we examine the parent VLOOKUP:
    =VLOOKUP("HP LaserJet 400 M401dn",Example_Printers.xlsx!Table2[#Data],COLUMN(),FALSE)

    We are looking for HP LaserJet 400 M401dn in the second table (the whole thing). We find it, and then .... COLUMN(). This returns the column number of the current field in Template.xlsx. In other words, sourabhg98 is expecting the Toner Part # and Toner Cost columns of Template.xlsx to be the same COLUMN() (column number) as in Table2 of Printers.xlsx.

    Question
    ok, so this is a problem. When I insert a new column between Printer Name and Toner Part # in Example_Template.xlsx, then the values for Toner Part # become the dollar values that Toner Cost was, and now Toner Cost shows #REF!. How can this be resolved?


    Solution (I think)
    I replace COLUMN() with the column number in Printers.xlsx for the same column name. There is a better solution than this though. I should be able to put together a VLOOKUP with what I have learned so far in this thread to find the column name in the other Excel workbook of a specific table using [#Data] and return the COLUMN() of that (or perhaps it is backwards -- COLUMN(VLOOKUP())?)
    I am having trouble putting together a formula for this. When I encounter col_index_num in COLUMN(VLOOKUP()) I don't know what to put.

    In the real Template.xlsx and Printers.xlsx I actually have a lot more columns in both workbooks and tabs. I provided a simplified example here in this thread to make it easier to read and help me.

    What this formula will do for me is allow me to calculate approximate printing operating expenses for the Company. I use PaperCuts Print Logger to log all print jobs to a CSV, then I import the CSV data into Template.xlsx (a pre-configured Workbook with a data table with additional columns calculating different things, pivot table, and pivot chart). I will implement this formula here, then I will be able to learn approximately how much the Company world-wide is spending on both paper+toner every fiscal quarter.

    And if you must inquire, I calculate for toner based on estimated page yields of cartridge part #s. We ship toner to our users when they request for a toner cartridge, and likewise we keep track of each shipment so then that way we can perform cost analysis on printers based on "actual usage" (aka how many toner cartridges they request for a specific printer in a given time period) to determine if it is cost effective to upgrade specific printers to a more expensive, higher duty cycle printer.

    I think by learning how to set this formula up --> breaking it down and analyzing why it works the way it does and how, I may be able to expand my works even further to correlate print job logs with the toner ship log.
    Last edited by BlueToast; 03-06-2015 at 03:43 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 04-06-2014, 01:26 PM
  2. [SOLVED] Finding unique occurences via Vlookup/Match/Index
    By jontherev in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-01-2014, 01:10 PM
  3. [SOLVED] Vlookup (IFS) 3 Condition Model Using Index /Match
    By Winship in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2014, 07:06 PM
  4. [SOLVED] Use of Imbedded formulas including VLOOKUP, INDEX and MATCH to determine fuel cost.
    By haloperidal in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-22-2012, 03:19 AM
  5. Que model using vlookup, count, index, match
    By Kalamingo in forum Excel General
    Replies: 6
    Last Post: 05-13-2008, 12:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1