Creating a lookup function within a lookup table

astewart28

New Member
Joined
Oct 10, 2018
Messages
6
Ok I'm trying to get a lookup function within another sheet & I'm completely lost :confused: hoping someone can direct me..

current formula reads: =IF(ISNUMBER(VLOOKUP(A2,Expenses!$A$2:$E$21,5,100)),"YES","NO")
where if the amount in E2:E21 has an output of 100, the answer would be yes. The entire table of course is A2:E21 but it has more columns than the standard 2, if that makes sense

Not sure if my column # is wrong or ISNUMBER is wrong, my textbook doesn't even have that definition in it, I've had to google so much this course. Thanks in advance!!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Welcome to the forum.

You're including the value you're looking for as a parameter within the VLOOKUP function. What you want to do is check the result of the VLOOKUP with 100, something like:

=IFERROR(IF(VLOOKUP(A2,Expenses!$A$2:$E$21,5)=100,"YES","NO"),"NO")

VLOOKUP will find the value of A2 in Expenses!$A$2:$A$21, and return the value from the same row in Expenses!$E$2:$E$21. Then you compare that with 100, and return "YES" or "NO". If VLOOKUP doesn't find A2, then it returns an error, and the IFERROR will trap that and return "NO". This is probably a simpler way to code it than with your ISNUMBER.

Also note that the parameter in VLOOKUP is pretty important. It's a True/False parameter, where 0=False, and non-zero=True. So when you put 100 there, it assumed True. True means approximate match, False means exact match. So if your range is not sorted, always use False (0). If it's sorted {1,5,7} but you don't want it to match if there's no match {2}, then use False. But if you want an approximate match, say if people get a bonus of 50 for sales between 1000 and 2000, and someone had sales of 1500, use True. You might want to do this:

=IFERROR(IF(VLOOKUP(A2,Expenses!$A$2:$E$21,5,0)=100,"YES","NO"),"NO")

Hope this helps.
 
Last edited:
Upvote 0
Oh my gosh, that would have took me hours of research & inputting data over & over to get that answer. I appreciate it!! Thank you do much!!!!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top