Ok so I am tryig to create a Vlookup to look for a user name that is located in 1 of several different workbooks. If B2 = BOB it will look for BOB in all the worksheets and return the correct value. There will never by a duplicate of BOB, it will always be a 1 to 1 relationship.
Here was my atempt that is not working at all.
=IF(ISNA(VLOOKUP(B3,'[Team 304.xlsx]Data'!$A:$J,4,FALSE)),VLOOKUP(B3,'[Team 304.xlsx]Data'!$A:$J,4,FALSE),IF(ISNA(VLOOKUP(B3,'[Team 302.xlsx]Data'!$A:$J,4,FALSE)),,IF(ISNA(VLOOKUP(B3,'[Team 303.xlsx]Data'!$A:$J,4,FALSE)),,(VLOOKUP(B3,'[Team 301.xlsx]Data'!$A:$J,4,FALSE)))))
I'm afraid your statement is completely wrong. You have confused the true and false actions and the 'true' actions of the second and third IFs are missing.
Here is the statement restructured :
=IF(ISNA(VLOOKUP(B3,'[Team 304.xlsx]Data'!$A:$J,4,FALSE)),
IF(ISNA(VLOOKUP(B3,'[Team 302.xlsx]Data'!$A:$J,4,FALSE)),
IF(ISNA(VLOOKUP(B3,'[Team 303.xlsx]Data'!$A:$J,4,FALSE)),
IF(ISNA(VLOOKUP(B3,'[Team 301.xlsx]Data'!$A:$J,4,FALSE)),
0,
VLOOKUP(B3,'[Team 301.xlsx]Data'!$A:$J,4,FALSE)),
VLOOKUP(B3,'[Team 303.xlsx]Data'!$A:$J,4,FALSE)),
VLOOKUP(B3,'[Team 302.xlsx]Data'!$A:$J,4,FALSE)),
VLOOKUP(B3,'[Team 304.xlsx]Data'!$A:$J,4,FALSE))
Obviously, you will need to put this on one line to make it work.
Related
i am trying to write a formula which when multiple cells are all "False" the cell will change to "Nothing" else if one of them is "True" it will change to that Cell tab name.
the thing is it worked fine regarding the 2nd part
[
and i used this formula
=INDEX($S$3:$V$3,SUMPRODUCT(MAX(($S$4:$V$4=O16)*(COLUMN($S$4:$V$4))))-COLUMN($S$3)+1)
but the problem is when all are False i get #VALUE!
so i found this code here on Stack
=IF(ISBLANK(<range>),"-",<your code>)
and used it on my Formula as follows
=IF(ISBLANK(W4),"-"=INDEX($S$3:$V$3,SUMPRODUCT(MAX(($S$4:$V$4=O16)*(COLUMN($S$4:$V$4))))-COLUMN($S$3)+1))
but i got False all the times without change
i manged to fix it as Dominique recommended and i added 2 new cloumns one of them which is the old fourmla
=INDEX($S$3:$V$3,SUMPRODUCT(MAX(($S$4:$V$4=O16)*(COLUMN($S$4:$V$4))))-COLUMN($S$3)+1)
the 2nd one is
=IF(W4="Nothing","FALSE","TRUE")
and edited the Status tab to be
=IF(ISNUMBER(SEARCH(X4,O17)),W4,Y4)
and at O17 a text wrriten "FALSE".
so if checked any box the tab name will be wriiten in Status else if none checked it will be wrriten Nothing.
Gif example:
Final
Let me give you a piece of advise: the =OR(...) function turns a bunch of FALSEs into one FALSE, but as soon as you have one TRUE, the result becomes TRUE:
All of the methods that I've used have 2 answer values (True or False).
How can I get the following with a formula?
If A1=1 then it's 11, if A1=2 the answer is 22, if A1=3 then it's 33, if A1=4 it's 44.
If the value your are evaluating is in cell A1, then the nested function would be as follows:
IF(A1=1,11,IF(A1=2,22,IF(A1=3,33,IF(A1=4,44,""))))
I put the 2 double commas at the end so the formula returns a blank instead of false.
I don't know if that's what you are asking about, but you can make multiple (nested) IF statements in one. For example:
IF(1=2;TRUE;IF(2=2;TRUE;FALSE))
You just put another IF in the FALSE part of IF statement. If that's not it, can you give a piece of the statement you tried and precise more what do you want?
=IF(AND(INT(A1)=A1,A1<=4,A1>=1),A1*11,"")
Now the above works for the condition you placed in your example, however if one were to go by your title alone you have a couple of options you could go with.
You first Option would be nested IF statements. Like you said each IF function has TRUE or FALSE. The trick is to put another IF function in for the TRUE result and another in for the FALSE results
IF(CHECK1, IF(CHECK2, TRUE2, FALSE2),IF(CHECK3, TRUE3, FALSE3))
The above give 4 potential results based on only 3 checks. Another option would be to do a check and supply a value for a TRUE result and another IF for a false result. Keep repeating the process. Conversely you could go the same route flipping TRUE FALSE option. It might look something like this:
IF(CHECK1, TRUE1, IF(CHECK2, TRUE2, IF(CHECK3, TRUE3, FALSE3)))
FALSE3 would be the result of all previous checks failing.
So for your case, your nested IF could look like (assuming the only valid entries are 1, 2, 3 and 4):
IF(A1=1,11,IF(A1,2,22,IF(A1=3,33,44)))
OR
IF(ISODD(A1),IF(A1=1,11,33),IF(A1=2,22,44))
and there are other options to work through the logic. there are also other checks you could be doing and results being displayed if your entries in A1 were not limited to the integers 1,2,3 and 4.
Now because you example is using the sequential integers 1,2,3 and 4 you could also use the CHOOSE function. Alternatively if you can make your criteria evaluate to sequential integers stating at 1 the CHOOSE function would work as well. Supply choose with an integer as the first argument and it will return the corresponding argument in the list that follows
CHOOSE(ARGUMENT,RESULT1, RESULT2,...,RESULTn-1, RESULTn)
In your case it would look something like:
CHOOSE(A1,11,22,33,44)
If you can not get sequential numbers for whatever reason and the gap is numbers is small and you are in the low integer count, you could leave a gap in results by providing "", or 0). lets say you has 1,3 and 4 as potential arguments, then your choose might look like:
CHOOSE(A1,11,"",33,44)
=IF(A1<>"",INDEX({11;22;33;44},A1),"")
=IF(AND(ISNUMBER(A1),A1<=4),A1*11,"")
I have a dataset that contains all baseball games played for numerous years. I am attempting to create win/loss streaks. I want the formula to check that the team, and the year remain constant while a decision is made based on if the team won or not. I have the data sorted by Team, and the dates are chronological. Previously I had used a nested if statement when I just had the data for one year. The formula that I am attempting to use is
=IF(M6=M5, IF(C6=C5, IF(G6="W",1+R5,0)), IF(G6="W",1,0), IF(G6="W",1,0)
=IF(Team=AboveTeam, If(Year=Aboveyear, If(Result=win, 1+abovewinsteak)), IF(Result=win, 1, 0), IF(result=win,1,0)
But I am getting the error that I have too many arguments. Any help would be much appreciated.
The IF statement with the condition C6=C5 is the one that had one two few arguments. You can try it this way.
=IF(M6=M5, IF(C6=C5, IF(G6="W",1+R5,0), IF(G6="W",1,0)), IF(G6="W",1,0))
Here's a rewritten version with fewer if statements and no duplication
=IF(G6="W",1+( IF(AND(M6=M5,C6=C5),R5,0)), 0)
IF( Result=Win, 1 + ( IF ( Team=AboveTeam AND Year=AboveYear, AboveWinStreak, Year or Team don't match so start over at 0 ), 0 because Result=Loss )
The top level ‘IF’ statement has too many arguments. The last two IFs seem out of place to me. I’m not sure of your logic, but assuming that you have a bunch of conditions that need to be met, the excel ‘IF’ formula signature is of the form:
IF(condition, if_true, if_false)
So you always need to put the next ‘IF’ in place of either ‘if_true’ or ‘if_false’. Within each parentheses pair there should be just 3 arguments.
Also, the 2nd IF has too few arguments (no ‘if_false’).
So, assuming that the last two IFs are in error; I think your formula should be:
=IF(M6=M5, IF(C6=“W”, IF(C6=C5, 1+R5, 1), 0), 0)
I have this IF statement:
=IF(AG3<=7,"1",IF(15<=AG3<=21,"2",IF(22<=AG3<=28,"3",IF(29<=AG3<=35,"4",IF(36<=AG3<=42,"5",IF(43<=AG3<=49,"6",IF(50<=AG3<=56,"7")))))))
but either it gives me a 1 or "FALSE"
All the values are within the ranges and should be showing various numbers
Excel does not use 50<=AG3<=56. The way Excel will read this is it will resolve AG3<=56 which will resolve to TRUE or FALSE which have the values of 1 and 0 respectively. And since 50 is greater than both those it will always return FALSE and since you did not specify a final false argument Excel returns FALSE
It needs to be AND(50<=AG3, AG3<=56)
Also "1" returns a number as text and not a true number, remove the quotes.
So:
=IF(AG3<=7,1,IF(AND(15<=AG3,AG3<=21),2,IF(AND(22<=AG3,AG3<=28),3,IF(AND(29<=AG3,AG3<=35),4,IF(AND(36<=AG3,AG3<=42),5,IF(AND(43<=AG3,AG3<=49),6,IF(AND(50<=AG3,AG3<=56),7,"Value not in specs")))))))
But based on your criteria you could use:
=IF(OR(AND(AG3>=8,AG3<=14),AG3>56),"Not to Spec",MATCH(AG3,{-1E+99,15,22,29,36,43,40}))
Don't use Nested IFs if you can avoid it. Instead, use a banded VLOOKUP: it's many times more efficient, and a heck of a lot simpler to troubleshoot. Something like the answer here:
Excel IF statement Not returning the appropriate Value
In your case, here's your lookup list:
Note that since you haven't specified what should happen between 8 and 14 or over 57 I have simply put =NA() in those bands.
And here's the result for a range of numbers:
...and here's the formula that was used in the second column of that second table (using table notation):
=VLOOKUP([#Value],Table3,2,TRUE)
I am trying to create a macro for the following formula. First though, I need to get the formula working when referencing a spreadsheet saved separately on the hard drive. Below is what I have but I am getting the error of Too many arguments.
=IFERROR(IF(C2<>"",IF(AND(VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE)="Assigned Attorney",OR(B2="Jimmy Edwards",B2="Kathleen McCarthy")),"Sales Team",IF(AND(VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE)="Intake Team, Assigned Attorney, or Sales Team",B2<>"Jimmy Edwards",B2<>"Kathleen McCarthy"),B2,IF(AND(VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE)="Intake Team, Assigned Attorney, or Sales Team",OR(B2="Jimmy Edwards",B2="Kathleen McCarthy")),"Sales Team",IF(VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE)="Assigned Attorney",B2,IF(AND(VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE)="Sales Team",OR(B2="Jimmy Edwards",B2="Kathleen McCarthy")),"Sales Team",IF(C2<>"",VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE),"INTAKE TEAM")))))), VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE),"")
Any help? When I go to the function help all of the arguments are okay but it highlights the "" at the end of my formula.
fwiw, you can use Alt+Enter to add line feeds to your long formula and add a little legibility. The line feeds and 'white-space' do not negatively impact the formula's performance in any way.
All I had to do to get it working in its current state was at a ) to ... ,FALSE)), "") at the tail end.
There is some repeated logic that could be paired up. Line 2 could be OR paired with line 6 and 9 and line 11 seems completely redundant as you are still following the TRUE path for the first IF(C2<>"",... and the 'nothing matches' default appears to be doubled up. Here is my best shot.
=IFERROR(IF(C2<>"",
IF(AND(
OR(VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B, 2, FALSE)={"Assigned Attorney","Sales Team","Intake Team, Assigned Attorney, or Sales Team"}),
OR(B2={"Jimmy Edwards","Kathleen McCarthy"})), "Sales Team",
IF(AND(VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE)="Intake Team, Assigned Attorney, or Sales Team",
OR(B2<>{"Jimmy Edwards","Kathleen McCarthy"})), B2,
IF(VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE)="Assigned Attorney", B2,
VLOOKUP(A2&"",[LPSMatch.xlsx]Sheet1!$A:$B,2,FALSE)))), "INTAKE TEAM"), "")
An OR function (or AND function) can compare to an array of constants; e.g. =if(or("BCD" = {"abc", "bcd", "cde"}), ... would be TRUE. Using this method reduces the VLOOKUP functions significantly.
Footnote: the formula you are using is for an external workbook that is open. You would need full path(s) to the workbook if it is closed. If you get the formula working, close the external workbook and all of the full path(s) will be added.