# Thread: Solved: if &amp; vlookup

1. ## Solved: if &amp; vlookup

`=IF(ISERROR(VLOOKUP(Question_1,Points_Q1,2,FALSE)),"Error",VLOOKUP(Question_1,Points_Q1,2,FALSE))`
i now need this code to look at range Question_4 and if this equals "Expection" then

`=IF(ISERROR(VLOOKUP(Question_1,Points_Q1,3,FALSE)),"Error",VLOOKUP(Question_1,Points_Q1,3,FALSE))`
other wise

`=IF(ISERROR(VLOOKUP(Question_1,Points_Q1,2,FALSE)),"Error",VLOOKUP(Question_1,Points_Q1,2,FALSE))`
Can anyone help?  Reply With Quote

2. ## Is this possible

if this helps this is the code I am trying to replace but the criteria above
```
.FormulaR1C1 = _
"=IF(OR(ISNA(MATCH(RC26,Ltable!R17C6:R22C6,0)),AND(RC21<>1,RC21<>2)),0,VLOOKUP(RC26,Ltable!R17C6:R22C8,IF(RC21=1,2,3),0))"```  Reply With Quote

3. =IF(NOT(ISNA(vlookup1)),vlookup1,IF(NOT(ISNA(vlookup2)),vlookup2,...  Reply With Quote

4. ## further help required

Sorry for late reply xld .. Been really ill. I don't understand your response can uclarify?  Reply With Quote

5. I was just giving you the syntax of how to do it, you would need to embed your formulae in the appropriate points.  Reply With Quote

6. thanks for the syntaxbutim stillhaving major issues with this what imn trying to acchieve is below
if question_4 is equal to "exception"
[VBA]
then
=IF(ISERROR(VLOOKUP(Question_1,Points_Q1,3,FALSE)),"Error",VLOOKUP(Question _1,Points_Q1,3,FALSE))
[/VBA]

other wise

Code:

[VBA]=IF(ISERROR(VLOOKUP(Question_1,Points_Q1,2,FALSE)),"Error",VLOOKUP(Question _1,Points_Q1,2,FALSE))[/VBA]  Reply With Quote

7. In VBA, embedded quotes need to be doubled up.  Reply With Quote

8. `=IF(Question_4="Exception",VLOOKUP(Question_1,Points_Q1,3),VLOOKUP(Question_1,Points_Q1,2))`
I have managed to createthis worksheet formula but the vlookup doesnt seem to work right   Reply With Quote

9. ## is this whatyoumean

`=IF(Question_4="Exception",IF(ISERROR(VLOOKUP(Question_1,Points_Q1,3,FALSE)),"error",VLOOKUP(Question_1,Points_Q1,3,FALSE)),IF(ISERROR(VLOOKUP(Question_1,Points_Q1,2,FALSE)),"error",VLOOKUP(Question_1,Points_Q1,2,FALSE)))`
this seems to work? can this be improved?  Reply With Quote

10. ## the vbaq code for anyonee reading this post inthe future, like xld said double up

`.FormulaR1C1 = "=IF(Question_4=""Exception "",IF(ISERROR(VLOOKUP(Question_1,Points_Q1,3,FALSE)),""Error"",VLOOKUP(Question_1,Points_Q1,3,FALSE)),IF(ISERROR(VLOOKUP(Question_1,Points_Q1,2,FALSE)),""Error"",VLOOKUP(Question_1,Points_Q1,2,FALSE)))"` is this right xld?   Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•