IF/VLOOKUP formula question

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
161
Hi all,

Probably a really simple answer to my question.

I've written the below formula to give me a tel number in a cell if one is held on another sheet and to show no tel held if it isn't there. The final part of the formula works fine but if i hold a tel number is gives me #value ! error.

=IF(VLOOKUP(E5,'Hidden stuff'!L2:R1275,7,FALSE),"<>","NO TEL HELD")

What do I need to put in the [velue is true] portion of the formula to show me the result? Or do i need to do something a lot simpler?

As always thanks in advance
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try this


=IFERROR(VLOOKUP(E5,'Hidden stuff'!L2:R1275,7,0),"NO TEL HELD")
 
Last edited:
Upvote 0
I tried that formula before and it gives me 0 as the result.

I think my formula at the top will work but I just need to know what to put where i have put "<>". I would like that value to be returned.
 
Upvote 0
You can perform the following exercise.
In cell E5 write the word "test". Now in cell L2 write the word "test", in cell R2 write the word "Hello".
The formula should return "Hello."
Change the word "test" in cell E5 to "xyz", the formula returns: "NO TEL HELD"

After those tests, perform the test with your data and tell me what you have in your cells and the result of the formula.
 
Upvote 0
Fixed with the following.

=IF(VLOOKUP(E5,'Hidden stuff'!L2:R1275,7,FALSE)>0,(VLOOKUP(E5,'Hidden stuff'!L2:R1275,7,FALSE)),"NO TEL HELD")
 
Upvote 0
But you still have the problem if the data in cell E5 does not exist in the range, it sends you the error #N/A


It can be corrected with:

=IF(IFERROR(VLOOKUP(E5,'Hidden stuff'!L2:R1275,7,FALSE)>0,0),(VLOOKUP(E5,'Hidden stuff'!L2:R1275,7,FALSE)),"NO TEL HELD")
 
Upvote 0
Yes i just found that out when i got rid of the data from E5. Thank you for that correction. The only problem i now have is if there isn't anything in E5 I get NO TEL HELD permanently showing.

I was hoping for the cell to be blank and then it only displays either NO TEL HELD or a tel number once I put data into E5?
 
Upvote 0
Try this

=IF(E5="","",IF(IFERROR(VLOOKUP(E5,'Hidden stuff'!L2:R1275,7,0)>0,0),(VLOOKUP(E5,'Hidden stuff'!L2:R1275,7,0)),"NO TEL HELD"))
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,212
Members
453,023
Latest member
alabaz

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