How Do I use vlookup to search multiple sheets - excel-formula

I am trying to populate a Case # on my contact sheet. The problem is there are three sheets the case # could be on. I have tried the formula
=IFERROR(VLOOKUP($d2,'Jane Tracker'!$A$3:$O$33,4,FALSE),
IFERROR(VLOOKUP($d2,'John Tracker'!$A$3:$O$33,4,FALSE),
IFERROR(VLOOKUP($d2,'Bugs Tracker'!$A$3:$O$33,4,FALSE))))
But I get a "too few arguments" error.

Drop the final IFERROR()
=IFERROR(VLOOKUP($d2,'Jane Tracker'!$A$3:$O$33,4,FALSE),IFERROR(VLOOKUP($d2,'John Tracker'!$A$3:$O$33,4,FALSE),VLOOKUP($d2,'Bugs Tracker'!$A$3:$O$33,4,FALSE)))
It's expecting another value and you just ended the formula.

Related

Searching for multiple words and using IF/OR/Vlookup function

I'm trying to create a formula that will search a cell for the following words.. "Other" & "Repair" if either of these words are found I want it to be categorized as the word that is found. If none of these words are found I want the formula to Vlookup another column to then categorize it.
I got the formula to work for one search word, I cant figure out how to do it with two search words.
below is the formula I used for one word search criteria.
=IF(ISNUMBER(SEARCH("REPAIR",B9089)),"REPAIR",VLOOKUP(E9089,Key!$D:$E,2,0))
This is what I tried doing for the two search words but it breaks at the end for the true / flase statement
=IF(OR(ISNUMBER(SEARCH("REPAIR",B9090)),ISNUMBER(SEARCH("OTHER",B9090))),"REPAIR""OTHER",VLOOKUP(E9090,Key!$D:$E,2,0))
If you need to search for two values and the values returned, an OR statement will not work. Since it will only return true or false to an IF statement, and the IF will then return only one value. Instead, you can nest two IF statements inside each other for each of the values you need to find. Try the following formula:
=IF(ISNUMBER(SEARCH("Repair",B9089)),"Repair",IF(ISNUMBER(SEARCH("Other",B9089)),"Other",VLOOKUP(E9089,Key!$D:$E,2,0)))
(I am assuming your references and the Vlookup statement are correctly written by yourself)
I think you'll need nested IF statements, like this:
=IF(ISNUMBER(SEARCH("REPAIR",B9089)),"REPAIR", IF(ISNUMBER(SEARCH("OTHER",B9089)),"OTHER",VLOOKUP(E9089,Key!$D:$E,2,0))
What this does is first check if "REPAIR" is part of the speciified cell's value, if it isn't it checks if the cell value contains "OTHER", and if that is not the case it performs the desired VLOOKUP.
Please not that this is doable for two conditions, but if it starts getting to higher numbers you should consider writing a custom function in VBA.

Excel index match with two different sheets gives me #VALUE error

I am trying to do an index match on two tables from two different sheets.
I have tried using a + sign to add the two different index match formulas
I have tried to add the index and match functions with commas
=IFERROR(INDEX(Building!$H$4:$H$3490,MATCH($I5,Building!$A$4:$A$3490,0)),0)
works
=IFERROR(INDEX(AltCapID!$H$2:$H$608,MATCH($A5,AltCapID!$A$2:$A$608,0)),0)
works
what I want is if the first condition doesn't exist to execute the second formula
Current formula:
=IFERROR(INDEX(Building!$H$4:$H$3490,MATCH($I6,Building!$A$4:$A$3490,0)),0)+IFERROR(INDEX(AltCapID!$H$2:$H$608,MATCH($A6,AltCapID!$A$2:$A$608,0)),0)
I6 matches the value in Building!$A$4:$A$3490 so I am expecting the results from Building!$H$4:$H$3490 instead I am getting an #VALUE error
After reading my answer again, I realized all I needed was an if statement. So I added
=IF(A5="",IFERROR(INDEX(Building!$H$4:$H$3490,MATCH($A5,AltCapID!$A$2:$A$608,0)),0)),IFERROR(INDEX(AltCapID!$H$2:$H$608,MATCH($A5,AltCapID!$A$2:$A$608,0)),0))
In my table Column A is empty if that cell is to be used
After editing your question, what you are looking is the following formula:
=IFERROR(INDEX(Building!$H$4:$H$3490,MATCH($I5,Building!$A$4:$A$3490,0)),IFERROR(INDEX(AltCapID!$H$2:$H$608,MATCH($A5,AltCapID!$A$2:$A$608,0)),0))

Use of multiple IF conditions in Excel

I'm trying to get a cell to pick a cell of data from a table using IF (Excel 2010, can't do IFS), but when I try to nest more than 2 IF, it returns a "too many arguments" error. Formula at this point:
=IF(B11="Humain",VLOOKUP(COO,Fonctions!A88:M110,2,FALSE),IF(OR(B11="Hybride Naturel",B11="Géno-Hybride"),VLOOKUP(COO,Fonctions!A88:M110,3,FALSE)))
Where am I doing it wrong? :/
You're missing a final comma should the second IF condition return false. Update your formula like so:
=IF(B11="Humain",VLOOKUP(COO,Fonctions!A88:M110,2,FALSE),IF(OR(B11="Hybride Naturel",B11="Géno-Hybride"),VLOOKUP(COO,Fonctions!A88:M110,3,FALSE),"N/A"))
Notice the N/A that will be produced should both IF statements do not yield any results.

Find Multiple Values Across Multiple Cells in Excel

I'm trying to figure out a way to search for multiple strings in Excel across multiple cells. I'm working with a database list of individuals and their corresponding address and demographic information. I need to find out a count and isolate the records of any cells with any of the names in the below formula in them. The formula works just fine when I'm only looking in one cell, ie B16, but when I put in for example (B16:D16) it throws a #VALUE error.
=IF(OR(B16={"JOHN","CATHLEEN","JANES"}),1,0)
Any help you can offer is very much appreciated.
Thanks,
Bill
=IF(OR(B16:D16="John",B16:D16="Cathleen",B16:D16="Janes"),1,0)
This works as long as at least one of the names is in the range. If none of the names are in the range it will throw the #Value error. You could trap that out by wrapping this formula in an "IFERROR" function. I'm not sure how much use this formula is in that it only tells you that at least one of the names exists in the range, not which name or where in the list.
Consider:
=IF((SUMPRODUCT(--(B16:D16="JOHN"))+SUMPRODUCT(--(B16:D16="JANES"))+SUMPRODUCT(--(B16:D16="CATHLEEN")))=0,0,1)

Excel formula Iferror

I have a drop down list (data validation) that populates other cells using vlookup that pulls data from a separate worksheet. I'd like to include an error message if the field is blank like "No data entered". However, I am getting "0" instead. Here is the formula I used:
=IFERROR(VLOOKUP(ChildName,Children,6,FALSE),"No data entered")
I then changed this to an ISERROR:
=IF(ISERROR(VLOOKUP(ChildName,Children,5,FALSE))=FALSE,"No data entered", VLOOKUP(ChildName,Children,5,FALSE))
This gives the error message appropriately but now my drop down list does not populate the other cells!
What am I doing wrong? Thank you!
Looking at your formulas, I see two noteworthy points:
in the IFERROR you return the 6th column, in the ISERROR, the 5th!
in the ISERROR, you show the error message when something is found, as you say =IF(ISERROR=FALSE,ErrorMsg,...)!
To solve your problem, simply use this formula: =IF(ChildName="","No data entered",IFERROR(VLOOKUP(ChildName,Children,6,0),"Cannot find "&ChildName))
Ah, I see! Check out this question - Have Excel formulas that return 0, make the result blank. It shows all ways.
My favorite is =IFERROR(1/1/VLOOKUP(ChildName,Children,6,0),"No data!"). Only works with numbers though.
Else, use =IF(VLOOKUP(ChildName,Children,6,0),VLOOKUP(ChildName,Children,6,0),"No data!").
To be on the safe side, this version should take care of all potential issues: =IFERROR(IF(VLOOKUP(ChildName,Children,6,0),VLOOKUP(ChildName,Children,6,0),"No data!"),"No data!")

Resources