Forum Discussion
psaavedra3
Sep 14, 2022Copper Contributor
If Statement with V look up
Hello, I have a formula that is working great but i need to add another condition to the if statement. Right now my formula is looking for ARRVW and if it finds it, it will do a vlookup and retur...
- Sep 14, 2022
Well, both Harun24HR and I asked for more of the context. The formula as shown makes references that require us to speculate as to what's in J2, among other things.
But it now appears that you are asking how to get the first part of the formula, the IF condition, to respond with a lookup whether or not X2 contains APRVW or APCRD at the start. Is that correct? And it's important to note that your current formula actually is asking whether or not X2 contains "APRVW:Firmwide:Firmwide", not merely "APRVW"
So although the formula could be revised to read
=IF(or(left(X2,5)="APRVW",left(X2,5)="APCRD"),VLOOKUP(MID(J2,1,1),'DoNotDelete_AP Assignments'!$A:$B,2,FALSE),"Not with AP")
HOWEVER, I'm not comfortable recommending that because, as noted in my first reply, you're hardcoding a variable into the formula. And, by definition, variables vary.
PLEASE, therefore, give us a look at the "bigger picture" here. What's the context. How variable are the conditions in the future. Do not engage in hardcoding without an awareness of its risks.
Harun24HR
Sep 14, 2022Bronze Contributor
Post your current formula and sample data. Also mention your version of Excel.
- psaavedra3Sep 14, 2022Copper ContributorI am using Microsift 365 and my current formula is below.
=IF(X2="APRVW:Firmwide:Firmwide",VLOOKUP(MID(J2,1,1),'DoNotDelete_AP Assignments'!$A:$B,2,FALSE),"Not with AP")