+ Reply to Thread
Results 1 to 4 of 4

Thread: Getting #Div/0! with an if statement referencing a vlookup.

  1. #1
    Registered User
    Join Date
    02-08-2008
    Posts
    18

    Getting #Div/0! with an if statement referencing a vlookup.

    I attached an example of my sheet.
    My vlookup displays it as a 0 if no data is present. For some reason my =IF(B6=0,100%,(100%-(C6/B6))) is getting a #DIV/0! even though it shows as 0 for C6&B6. Could it be because of the vlookup?
    Attached Files Attached Files

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    Your formulas with vlookup have the 0 in quotes. Remove the quotes and all will be fixed..

    e.g.

    =IF(ISNA(VLOOKUP(A3,Sheet2!A3:C5,2,FALSE)),0,VLOOKUP(A3,Sheet2!A3:C5,2,FALSE))
    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.

  3. #3
    Registered User
    Join Date
    10-18-2006
    Posts
    47
    In your formula below do you see the "0" ?

    =IF(ISNA(VLOOKUP(A6;Sheet2!A6:C8;3;FALSE));"0";VLOOKUP(A6;Sheet2!A6:C8;3;FALSE))

    remove the quotes (") around it and it will work fine.

  4. #4
    Registered User
    Join Date
    02-08-2008
    Posts
    18
    Thank you for your help. It solved my issue. Thanks Again!

+ Reply to Thread

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