+ Reply to Thread
Results 1 to 13 of 13

Need help to resolve #N/A error from VLOOKUP

  1. #1
    Registered User
    Join Date
    04-20-2021
    Location
    London, England
    MS-Off Ver
    16.47.1 Excel
    Posts
    3

    Question Need help to resolve #N/A error from VLOOKUP

    Hi all,

    I am new to excel but am trying to complete a uni assignment.

    I am making a food consumption log where I have columns labelled "Food", "Servings", "Calories", "Fat", "Protein", "Carbs" and "Fibre."

    The "Food" column consists of a drop down box of thousands of food options from a "Food Nutrition Data" sheet that lists the food and its corresponding calories, fat, protein, carbs and fibre content horizontally for each food. My task is to input a formula into the "food consumption log" sheet that will retrieve the Calories, Fat, Protein, Carbs, and Fibre from "Food Nutrition Data" sheet and multiply it by the servings in the second column for whatever food the user selects from the "Food" drop down box.

    The formula I am using is =IF($C2="","",$D2*VLOOKUP($C2,FoodLookup,MATCH(E$1,'Food Nutrition Data'!$C$1:$H$1,0),0)) but it keeps saying #N/A. (FoodLookup is just the named range for the data in the Food Nutrition Table)

    I hope you can understand what I'm trying to do from this description. Any help is appreciated!

    Thank you

    Food Nutrition Data: Food Nutrition Data.png
    Food Consumption Log: Food Consumption Log.png

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Need help to resolve #N/A error from VLOOKUP

    is it possible to upload a sample workbook AND if so, please hand enter in an adjacent cell the expected results.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    04-20-2021
    Location
    London, England
    MS-Off Ver
    16.47.1 Excel
    Posts
    3

    Re: Need help to resolve #N/A error from VLOOKUP

    Hi Sam, thanks for your reply!

    I have attached some sections of the workbooks I am working in and have included the expected results. I am not sure if this is what you meant but I hope it helps

    I have also attached a workbook I found online that I have been trying to copy as it does a similar thing to what I'm trying to do.

    Thanks!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-20-2021
    Location
    London, England
    MS-Off Ver
    16.47.1 Excel
    Posts
    3

    Re: Need help to resolve #N/A error from VLOOKUP

    Replied below!

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Need help to resolve #N/A error from VLOOKUP

    I would use this simple vlookup in E2 and dragged down and right from there.
    It keys on the match between the food description in col C of the consumption log and the match to the food nutrition data tab col C.
    if the match isn't exact you'll get a #N/A error (spaces in one that aren't in the other for example).

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Need help to resolve #N/A error from VLOOKUP

    In E2 copied across and down:

    =$D2*INDEX('Food Nutrition Data'!D$2:D$6,MATCH($C2,'Food Nutrition Data'!$C$2:$C$6,0))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Re: Need help to resolve #N/A error from VLOOKUP

    Formula Above is really works for this thread.
    Last edited by jasond1992; 04-21-2021 at 03:22 AM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Need help to resolve #N/A error from VLOOKUP

    Sorry for off-topic interjection:

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    On this occasion, you just seem to have copied the solution I gave in post #6.

  9. #9
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Re: Need help to resolve #N/A error from VLOOKUP

    Wahhhhhhh sorry ma'am I didn't get your formula. I have the same scenario with the thread that's why I try to give it to him. But when I see right now your formula it's literally the same. for that ma'am I will edit my answer for this thread. I promise I didn't not copy and I didn't see the formula before I get his example documents. Sorry AliGW.

  10. #10
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Need help to resolve #N/A error from VLOOKUP

    What happened to the formula I pasted?
    which I thought was this... =$D2*VLOOKUP($C2,'Food Nutrition Data'!$C2:D6,COLUMN(B$1),FALSE)

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Need help to resolve #N/A error from VLOOKUP

    There was no formula in your post when I first looked at the thread, Sam, and your post hasn't been edited by anyone - maybe your copy paste didn't work?

  12. #12
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Need help to resolve #N/A error from VLOOKUP

    yes, I could swear I saw the formula there before I logged off which is weird. I noticed that there was no "edited" note under my post.
    well, that is what I worked on for what it was worth.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Need help to resolve #N/A error from VLOOKUP

    Well, at least ours are different from each other's!!!

+ 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. how to resolve blank error
    By Merrysa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-12-2019, 09:32 AM
  2. How to resolve Run Time Error-1004
    By Sanjibghosh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-14-2017, 03:24 AM
  3. [SOLVED] unable to resolve error 424
    By rickmeister in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-28-2017, 04:46 PM
  4. Vlookup problem - need to resolve duplicates
    By Cryndalae in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-01-2016, 05:55 AM
  5. How can I resolve this VLOOKUP #REF error?
    By Nate Westcott in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-14-2015, 07:26 AM
  6. [SOLVED] Help to resolve Run time Error 380
    By LenaK in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-30-2015, 11:55 AM
  7. Add ISERROR to resolve DIV/0 error
    By mtntxn in forum Excel General
    Replies: 2
    Last Post: 09-28-2009, 04:58 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