+ Reply to Thread
Results 1 to 5 of 5

Lookup Function - Needs to give 0 when cannot find, HELP

  1. #1
    Registered User
    Join Date
    08-25-2011
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    3

    Lookup Function - Needs to give 0 when cannot find, HELP

    Hi

    I have 2 sheets in one workbook on Excel 2010.

    I want the sheet to look up the code in column A and match it in the spreadsheet 2 and then return a result in a column.

    The formula i have now works apart from, when it does not match or find the code, it just gives me a random numbr returned like 3000!? Here is the lookup formula below.

    How do i sort the formula so it then gives me a 0 if the code from Products!C441 is not found in Current Stock'!A$3:A$5558?

    =LOOKUP(Products!C441,'Current Stock'!A$3:A$5558,'Current Stock'!J$3:J$5558)

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Lookup Function - Needs to give 0 when cannot find, HELP

    Maybe:

    =IFERROR(VLOOKUP(Products!C441,'Current Stock'!A$3:J$5558,10,FALSE),0)

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    08-25-2011
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Lookup Function - Needs to give 0 when cannot find, HELP

    Thank you, that one did work. However.. I have 3 columns doing the same type of thing. I copied it to the second column and changed what i thought i should and it did not work.

    Here is what it had

    =LOOKUP(Products!C442,'Current Stock'!A$3:A$5558,'Current Stock'!K$3:K$5558)

    I changed after your post to

    =IFERROR(VLOOKUP(Products!C442,'Current Stock'!A$3:K$5558,10,FALSE),0)

    What am i doing wrong!?

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Lookup Function - Needs to give 0 when cannot find, HELP

    You need to change the column index:

    =IFERROR(VLOOKUP(Products!C442,'Current Stock'!A$3:K$5558,11,FALSE),0)

    Dom

  5. #5
    Registered User
    Join Date
    08-25-2011
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Lookup Function - Needs to give 0 when cannot find, HELP

    Seriously smart! Thanks so much, i have been trying to figure it out for hours! Thanks so much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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