+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    519

    IF and VLOOKUP formula.

    How's it going, smart people?

    I'm having problems with a formula that I want to return a result IF a certain value is found in another cell. I've attached a sample workbook, but here's a description:

    On the "Inventory" worksheet, in column H, I want to lookup the quantity in column B from the "Warehouse Response" worksheet. If the Part # in column E of the response sheet is NI1088106, I want THAT value to show under the NI1088106 part number, and I want the quantities for the NI1089106 to show under that part number. Ideally, the result of the formula would show a "0" if no data is found.

    Here's the formula I tried beside the NI1088106 data, but it's not giving the desired results:

    =IF('Warehouse Response'!E:E="NI1088106", VLOOKUP(LEFT(A3,3),data,2,0))

    Thanks in advance for any help you can offer.
    Attached Files Attached Files
    Last edited by hutch@edge.net; 07-02-2009 at 12:22 PM.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: IF and VLOOKUP formula.

    With your current setup you would really be obliged to go with a SUMPRODUCT:

    Code:
    H3:
    =SUMPRODUCT(--('Warehouse Response'!$A$12:$A$34=LEFT(Inventory!$A3,3)),--("("&'Warehouse Response'!$E$12:$E$34&")"=$B3),'Warehouse Response'!$B$12:$B$34)
    Lots of SUMPRODUCTs are bad news IMO and best avoided.

    You could use a LOOKUP(2,1/ approach but that would be not be quick and would necessitate a handler for no results.

    Your best bet IMO would be to create a concatenation on Warehouse Response such that:

    Code:
    H12: =$A12&":("&$E12&")"
    copied down
    You can then use a standard SUMIF on your summary sheet which will be far more efficient long term, ie:

    Code:
    H3: =SUMIF('Warehouse Response'!$H:$H,LEFT($A3,3)&":"&$B3,'Warehouse Response'!$B:$B)

  3. #3
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,114

    Re: IF and VLOOKUP formula.

    To me what your attempted formula is referencing does not match what you are describing.. this leads me to confusion as to what it is you really want.

    Can you try again.. .also.. I see many quantity columns in the Inventory sheet.. which are we working with?
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    519

    Re: IF and VLOOKUP formula.

    Thanks for the response, guys.

    Your approach works perfectly, DonkeyOte. Thanks!!

Thread Information

Users Browsing this Thread

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

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