+ Reply to Thread
Results 1 to 7 of 7

VLOOKUP array causing error in one cell, but not another

  1. #1
    Forum Contributor
    Join Date
    11-08-2017
    Location
    Murfreesboro, TN
    MS-Off Ver
    MS 365
    Posts
    168

    VLOOKUP array causing error in one cell, but not another

    Hi.

    I have the following formula that I copied down a column of 100 rows. The formula worked on all but 2 of the cells. Those 2 cells return #VALUE!.

    =ROUNDUP(J32/VLOOKUP(B32,Recipes!$A$5:$O$104,10)*2,0)/2

    When I change the array to $A$5:$0$59 the formula works. If I choose any number between $O$60 & $O$104 I get the error.

    I tried deleting the formula out of both cells and manually typing them in, but that did not work.

    Any help is appreciated.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: VLOOKUP array causing error in one cell, but not another

    I expect you'd get #VALUE! error if the VLOOKUP returns a text value from column J - is that possible?

    Try just using the VLOOKUP on it's own - what do you get in the rows where you got the errors?
    Audere est facere

  3. #3
    Forum Contributor
    Join Date
    11-08-2017
    Location
    Murfreesboro, TN
    MS-Off Ver
    MS 365
    Posts
    168

    Re: VLOOKUP array causing error in one cell, but not another

    The J column contains the number 26.5, which is a sum of 5 other cells. It should be divided by a number that is being looked up on another page via VLOOKUP and then rounded up to the nearest .5.

    It worked as it should on the cells above it, but for some reason it doesn't on this cell and the one directly below it.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VLOOKUP array causing error in one cell, but not another

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    11-08-2017
    Location
    Murfreesboro, TN
    MS-Off Ver
    MS 365
    Posts
    168

    Re: VLOOKUP array causing error in one cell, but not another

    Thanks Norie.

    I am not sure how to make a mock-up. This spreadsheet is huge and all of the pages refer to each other. I will see if I can come up with something tomorrow.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: VLOOKUP array causing error in one cell, but not another

    Quote Originally Posted by LKERN View Post
    The J column contains the number 26.5, which is a sum of 5 other cells.
    I actually meant column J on the other worksheet, that’s the column (column 10) that your VLOOKUP is returning a value from.

    For debugging purposes just try VLOOKUP on its own, i.e just

    =VLOOKUP(B32,Recipes!$A$5:$O$104,10)

    what do you get with that on problem rows? I suspect it’s returning a text value and then that leads to the error when you try to do some mathematical operation on a text value.

    Btw, your VLOOKUP has no 4th argument which means that it will only work correctly if Recipes!A5:A104 is sorted ascending, is that the case? If not, and/or you expect an exact match then you should add FALSE AS THE 4th argument in VLOOKUP

  7. #7
    Forum Contributor
    Join Date
    11-08-2017
    Location
    Murfreesboro, TN
    MS-Off Ver
    MS 365
    Posts
    168

    Re: VLOOKUP array causing error in one cell, but not another

    daddylonglegs,

    Thanks so much for your help. I checked the J column (column 10) on the VLOOKUP sheet and it was the number "5.00", formmatted as the number, not text.

    I had also already tried deconstructing the formula and found that when I changed the array to end at anything lower than $O$60 the formula worked.

    I do already have the list sorted ascending alphabetically.

    I added the 4th argument to the VLOOKUP and it worked! I'll go in and add that on all of the VLOOKUP formulas.

    I am learning Excel by Googling what I need to do, so I don't always get all of the information I need and I don't know what I don't know a lot of the time.

    I appreciate all of the responses that I received to my question.

+ 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. [SOLVED] Empty cell causing summation error, how to make it a "0"?
    By brucemc777 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-30-2015, 03:06 PM
  2. VLOOKUP lookup data (possibly) causing N/A error message due to formatting?
    By Jim_Davidson in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 08-05-2015, 09:36 AM
  3. vlookup table array #ref error
    By kbaz555 in forum Excel General
    Replies: 3
    Last Post: 08-27-2014, 01:18 PM
  4. [SOLVED] #Value in array causing Type Mismatch in comparision
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-04-2013, 01:40 PM
  5. Replies: 2
    Last Post: 02-23-2011, 07:24 AM
  6. SUMPRODUCT array reference causing #N/A
    By cedarhill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2009, 02:08 PM
  7. VLOOKUP Formula causing an error
    By japc90 in forum Excel General
    Replies: 2
    Last Post: 07-25-2006, 06:40 PM

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