+ Reply to Thread
Results 1 to 9 of 9

My problems with VLOOKUP

  1. #1
    Registered User
    Join Date
    04-13-2013
    Location
    Redcar
    MS-Off Ver
    2010
    Posts
    5

    My problems with VLOOKUP

    As part of a college assignment I've been asked to create an IT support request form, one of the assignment criteria is that the form should include the total time spent fixing each (multiple) faults, as well as the cost for repairing all the faults based on an hourly rate.

    The values for the time taken to repair each fault and the repair fees were pre-decided my problem is that the amount of faults can be different at any given time depending on how many faults the user has actually encountered, which means that certain fields are left blank, using the =SUM function returns #NA.

    The only solution I can think of is assigning a blank cell the value of 0 in my lookup range, and even then i wouldn't know how I would go about doing that.

    Any help or insight would be most appreciated.

  2. #2
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: My problems with VLOOKUP

    Hi - Welcome to the forum. Would be helpful if you could upload a sample file along with the output you are trying to work out to get efficient responses.

    To upload your file, click on "Go Advanced" and look for the attachment symbol.

    Thanks.
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  3. #3
    Registered User
    Join Date
    04-13-2013
    Location
    Redcar
    MS-Off Ver
    2010
    Posts
    5

    Re: My problems with VLOOKUP

    book2.xlsm

    F1, F2, F3 represent fault1, 2, 3, these are the cells I'm using for VLOOKUP function and will be hidden in the final version of the form.

    when the blank field from the fault drop down menus is selected the output cells, repair cost and repair time returns #N/A
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: My problems with VLOOKUP

    Becuase there is nothing to lookup there will be #NAs as a result. To 'hide' this output use IFERROR on your formulas that could return #NA.

    For example
    =VLOOKUP(A1,Sheet2!A:C,2,0) is a formual that works fine except when A1 is blank or A1 is not found in the lookup table and therefore results in an error.

    =IFERROR(VLOOKUP(A1,Sheet2!A:C,2,0),"") does the exact same job as before excpet when there is an error the IFERROR kicks in to output "" which leaves the cell blank

    You can change the "" to "TextOfChoice" or a number or another formula.
    Say thanks, click *

  5. #5
    Registered User
    Join Date
    04-13-2013
    Location
    Redcar
    MS-Off Ver
    2010
    Posts
    5

    Re: My problems with VLOOKUP

    I know there's nothing to look up, but suppose someone had just the one fault or two I would still want them to be able to submit a report and for the form to display the total time and costs of those two figures. I need the blank cell to represent the value of 0 for the formula or an alternative way to total the values from the lookup.

    Thank you for the information you've provided though I can definitely think of instances where I could use those.

  6. #6
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: My problems with VLOOKUP

    Zezima - using IFERROR (per post #4) is the most ideal way to overcome errors but please note that the resultant outputs will always be 0 since the lookup table does not have any provision for a blank Fault field...

  7. #7
    Registered User
    Join Date
    04-13-2013
    Location
    Redcar
    MS-Off Ver
    2010
    Posts
    5

    Re: My problems with VLOOKUP

    Ok, thanks for your feedback. Would you be able to offer any alternatives to VLOOKUP?

  8. #8
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: My problems with VLOOKUP

    For your purpose that's the most simple way i suppose

    Though other ways are using combination of Index and Match Functions etc...

  9. #9
    Registered User
    Join Date
    04-13-2013
    Location
    Redcar
    MS-Off Ver
    2010
    Posts
    5

    Re: My problems with VLOOKUP

    I assigned the range in question the name =("") and the value 0.0 and it solved my problem thank you to everyone who contributed to the post and provided information.

+ 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