View Full Version : Solved: if & vlookup

khalid79m

12-03-2008, 03:35 AM

=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?

khalid79m

12-03-2008, 04:58 AM

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))"

Bob Phillips

12-03-2008, 06:24 AM

=IF(NOT(ISNA(vlookup1)),vlookup1,IF(NOT(ISNA(vlookup2)),vlookup2,...

khalid79m

12-11-2008, 03:45 AM

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

Bob Phillips

12-11-2008, 04:05 AM

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

khalid79m

12-14-2008, 01:02 PM

thanks for the syntaxbutim stillhaving major issues with this what imn trying to acchieve is below

if question_4 is equal to "exception"

then

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

other wise

Code:

=IF(ISERROR(VLOOKUP(Question_1,Points_Q1,2,FALSE)),"Error",VLOOKUP(Question_1,Points_Q1,2,FALSE))

Bob Phillips

12-14-2008, 01:14 PM

In VBA, embedded quotes need to be doubled up.

khalid79m

12-14-2008, 01:29 PM

=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:dunno

khalid79m

12-14-2008, 01:36 PM

=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,Point s_Q1,2,FALSE)),"error",VLOOKUP(Question_1,Points_Q1,2,FALSE)))

this seems to work? can this be improved?

khalid79m

12-14-2008, 02:08 PM

.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,Point s_Q1,2,FALSE)),""Error"",VLOOKUP(Question_1,Points_Q1,2,FALSE)))":friends:

is this right xld?:thumb

Powered by vBulletin® Version 4.2.5 Copyright © 2020 vBulletin Solutions Inc. All rights reserved.