+ Reply to Thread
Results 1 to 9 of 9

Vlookup, Hlookup, otherlookup?

  1. #1
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35

    Vlookup, Hlookup, otherlookup?

    I have a wksheet(named 'Invoice') that is used as a form to input the amount and type of certain items rented for a certain event as well as the date of set up and pick up of the items. After the form is completed a save form button is used to save the form in a different wkbook and clear the contents of the form. Each form has a corresponding number and I'm using this number in an if statement to record the setup and pickup dates in another wksheet('InventoryOut'). In this wksheet I have an array with rentals on the horizontal axis and Invoice # on the vertical axis. The if statement basically say "If the invoice # in 'InventoryOut'=the invoice # currently in the 'Invoice' wksheet then take the setup and pick up dates from 'Invoice' and record them in 'InventoryOut'.
    My problem is trying to record the quantity under the correct type in 'InventoryOut'. I've tried using vlookup and hlookup, but I cannot identify my problem.
    The attached file should bring more clarity to my words and includes my failed attempts at using the lookups.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello jrcream,

    Having merged cells on a worksheet will confuse VLOOKUP. You will either need to reformat the invoice worksheet, so there are no merged cells, or use a UDF (User Defined Function) to return the information.

    Your code seems to be checking the invoice for each type of rental, and not a total for each rental. Is that what you want?

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35
    Having merged cells confuses Vlookup even if the merged cells are not in the range being looked up?

    Your code seems to be checking the invoice for each type of rental, and not a total for each rental. Is that what you want?
    No, I'm trying to get the total, but it has to fall under the correct type on the inventoryout wksheet.

    Thanks Leith Ross

  4. #4
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35
    Since the value to be looked up isn't in the far left column I'm attempting to use INDEX and MATCH to fix the problem, but ita proved more difficult then I imagined. Is there a more effecient way and if not whats wrong with my code?

    =IF(A4=Invoice!C3,INDEX(Invoice!$A$15:$B$33,MATCH(D1,Invoice!B15:B33,0),MATCH(Invoice!A1,1:1,0)),0)

  5. #5
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35

    nm-I figured my problem out, thanks

    I used a an IF statement with a combination of MATCH and INDEX

    =IF('[autosaveinvoice.xls]Inventory Out'!A4=[autosaveinvoice.xls]Invoice!C3,INDEX([autosaveinvoice.xls]Invoice!$A$16:$A$33,MATCH('[autosaveinvoice.xls]Inventory Out'!D1,[autosaveinvoice.xls]Invoice!$B$16:$B$33,0)),0)

  6. #6
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35

    Rephrase

    Im just going to rephrase my question with pictures included for I feel my previous posts weren't that clear.

    I have a button with an assigned macro that saves the invoice wksheet and I want to add some important features to. I have been trying to lookup the row in the InventoryOut wksheet (Exhibit E)*that contains the same value as the Invoice # in the Invoice wksheet(A). Once the row is looked up I'd like to trasfer a number of pieces of pertinent info into the InventoryOut wksheet from the Invoice sheet such as the pickup and setup dates(from B & C to G)*as well as the number of each item rented(from D to F).
    Attached Images Attached Images

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello jrcream,

    Are you restating this as a reference to your solution or because you still need help???

    Sincerely,
    Leith Ross

  8. #8
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35
    When I thought I had the solution I found out that my IF statement wouldn't work because everytime an invoice is saved the IF statement doesn't match (the invoice #s on the different sheets).
    So I still need some help.

  9. #9
    Registered User
    Join Date
    07-22-2008
    Location
    ctown
    Posts
    35
    In other words I need to add to the VBA code assigned to the button 'save invoice'.

+ 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. Vlookup using two columns-needs to match the first two column
    By pduubb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-01-2008, 01:21 PM
  2. VLookup and Hlookup combined using separate workbooks
    By trentonm in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2008, 03:18 PM
  3. Vlookup & Hlookup Combination
    By gurpreet161 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2008, 03:49 PM
  4. vlookup - hlookup
    By Superslinky in forum Excel General
    Replies: 5
    Last Post: 11-13-2007, 05:25 PM
  5. mix vlookup and hlookup or another function
    By arnaud23 in forum Excel General
    Replies: 2
    Last Post: 05-12-2007, 07:12 AM

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