ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   vlookup in if (https://www.excelbanter.com/excel-worksheet-functions/73354-vlookup-if.html)

Alec Green

vlookup in if
 
can you uses vlookup within an if statement, I can both functions to work
separately but not together.

Thanks

Alec



Pete_UK

vlookup in if
 
Yes,you can use VLOOKUP( ) within an IF statement. Tell us what you
want to do and we might be able to help further.

Pete


Alec Green

vlookup in if
 
My VLookup is =VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)

and i'm trying to do something like this
=IF(A1="yes",VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FAL SE)
+20%,VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)

basically if A1 is yes, then vlookup the value in products plus 20%, if A1
is not yes then just return the vlookup value

Thanks!

"Pete_UK" wrote in message
ups.com...
Yes,you can use VLOOKUP( ) within an IF statement. Tell us what you
want to do and we might be able to help further.

Pete




Dave Peterson

vlookup in if
 
You could use:

=if(a1="yes",1.2*vlookup(...),vlookup(...))

or maybe just:

=vlookup(...)*if(a1="yes",1.2,1)



Alec Green wrote:

My VLookup is =VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)

and i'm trying to do something like this
=IF(A1="yes",VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FAL SE)
+20%,VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)

basically if A1 is yes, then vlookup the value in products plus 20%, if A1
is not yes then just return the vlookup value

Thanks!

"Pete_UK" wrote in message
ups.com...
Yes,you can use VLOOKUP( ) within an IF statement. Tell us what you
want to do and we might be able to help further.

Pete


--

Dave Peterson

Pete_UK

vlookup in if
 
Yes, you can't just add 20% to the value returned by the vlookup as you
are trying to do, you have to multiply this value by 1.2 (i.e. 120%) as
Dave suggests.

Pete


Alec Green

vlookup in if
 
can you give me an example of the whole formula please

"Pete_UK" wrote in message
oups.com...
Yes, you can't just add 20% to the value returned by the vlookup as you
are trying to do, you have to multiply this value by 1.2 (i.e. 120%) as
Dave suggests.

Pete




Pete_UK

vlookup in if
 
Ok, copying yours down from above:

=IF(A1="yes",VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FAL SE)*1.2,
VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE))

You had missed off a bracket at the end.

Hope this helps.

Pete


Alec Green

vlookup in if
 
thanks!

"Pete_UK" wrote in message
oups.com...
Ok, copying yours down from above:

=IF(A1="yes",VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FAL SE)*1.2,
VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE))

You had missed off a bracket at the end.

Hope this helps.

Pete




Pete_UK

vlookup in if
 
You're welcome.

Pete


Dave Peterson

vlookup in if
 
I think I would have used:

=VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)*if(a1="y es",1.2,1)

I think it's easier to understand (and it does less stuff).

Alec Green wrote:

can you give me an example of the whole formula please

"Pete_UK" wrote in message
oups.com...
Yes, you can't just add 20% to the value returned by the vlookup as you
are trying to do, you have to multiply this value by 1.2 (i.e. 120%) as
Dave suggests.

Pete


--

Dave Peterson

Pete_UK

vlookup in if
 
Yeah, I thought about putting that version for the OP as well, but then
he already had the other one so it would be easier for him to edit that
(only 4 characters needed changing, plus his missing bracket).

Pete



All times are GMT +1. The time now is 08:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com