Taking out the DIV and N/A Errors in a Vlook up

exeldc

Board Regular
Joined
Sep 20, 2012
Messages
51
Hello Forum

Just took on a new workbook and noticed that the person before did not build their formulas for DIV and NA errors. :eek:

How can I adjust the following formula to have these areas turn to "0" instead of the errors. Thank you

=VLOOKUP($J$1,Today_FOOD,10,FALSE)/VLOOKUP($J$1,Today_FOOD,9,FALSE)
=(VLOOKUP($C8,Today_FOOD,37,FALSE))/(VLOOKUP($C8,Today_FOOD,36,FALSE))
=VLOOKUP($C15,Today_FOOD,17,FALSE)
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

OFFICE360

New Member
Joined
Sep 26, 2014
Messages
9
Try using IFERROR or If(ISNA to handle the error.
Example=IFERROR(VLOOKUP($J$1,Today_FOOD,10,FALSE)/VLOOKUP($J$1,Today_FOOD,9,FALSE),0)
 

exeldc

Board Regular
Joined
Sep 20, 2012
Messages
51
Ok those worked!

What about =(VLOOKUP($J$1,Today_FOOD,37,FALSE)/VLOOKUP($J$1,Today_FOOD,36,FALSE))-(VLOOKUP($J$1,Yesterday_FOOD,37,FALSE)/VLOOKUP($J$1,Yesterday_FOOD,36,FALSE))
 

OFFICE360

New Member
Joined
Sep 26, 2014
Messages
9
I think you should add handlers for each of them or maybe change formula because any of those formula error will trigger IFERROR.

In short
=IFERROR(
(VLOOKUP($J$1,Today_FOOD,37,FALSE)/VLOOKUP($J$1,Today_FOOD,36,FALSE))-(VLOOKUP($J$1,Yesterday_FOOD,37,FALSE)/VLOOKUP($J$1,Yesterday_FOOD,36,FALSE)),"Error")

I cannot confirm the formula for you because my office is under re-installations...

 

exeldc

Board Regular
Joined
Sep 20, 2012
Messages
51

ADVERTISEMENT

Also I tried changing the formula below =(VLOOKUP($C8,Today_FOOD,37,FALSE))/(VLOOKUP($C8,Today_FOOD,36,FALSE))

to =IFERROR(VLOOKUP($C8,Today_FOOD,37,FALSE))/(VLOOKUP($C8,Today_FOOD,36,FALSE),0) but got a message saying Ive entered too few arguments
 

OFFICE360

New Member
Joined
Sep 26, 2014
Messages
9
check for missing brackets

=IFERROR((VLOOKUP($C8,Today_FOOD,37,FALSE))/(VLOOKUP($C8,Today_FOOD,36,FALSE)),0)
 

exeldc

Board Regular
Joined
Sep 20, 2012
Messages
51
Yeah also tried =IFERROR((VLOOKUP($J$1,Today_FOOD,37,FALSE)/VLOOKUP($J$1,Today_FOOD,36,FALSE))-(VLOOKUP($J$1,Yesterday_FOOD,37,FALSE)/VLOOKUP($J$1,Yesterday_FOOD,36,FALSE)),"Error") but got the error

 

Watch MrExcel Video

Forum statistics

Threads
1,109,445
Messages
5,528,801
Members
409,835
Latest member
Mafu1267

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top