#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Alec Green
 
Posts: n/a
Default vlookup in if

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

Thanks

Alec


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Alec Green
 
Posts: n/a
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Alec Green
 
Posts: n/a
Default 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



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default 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

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Alec Green
 
Posts: n/a
Default 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



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default vlookup in if

You're welcome.

Pete

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default 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


  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using single cell reference as table array argument in Vlookup CornNiblet Excel Worksheet Functions 3 September 22nd 05 09:15 AM
VLOOKUP Limitations chris_manning Excel Worksheet Functions 2 August 9th 05 06:23 PM
Have Vlookup return a Value of 0 instead of #N/A Mr Mike Excel Worksheet Functions 4 May 25th 05 04:51 PM
vlookup data hidden within worksheet Excel Worksheet Functions 0 January 26th 05 12:09 PM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"