close

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

Thanks

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

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

and i'm trying to do something like this
=IF(A1=quot;yesquot;,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!

quot;Pete_UKquot; gt; wrote in message ups.com...
gt; Yes,you can use VLOOKUP( ) within an IF statement. Tell us what you
gt; want to do and we might be able to help further.
gt;
gt; Pete
gt;
You could use:

=if(a1=quot;yesquot;,1.2*vlookup(...),vlookup(...))

or maybe just:

=vlookup(...)*if(a1=quot;yesquot;,1.2,1)
Alec Green wrote:
gt;
gt; My VLookup is =VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)
gt;
gt; and i'm trying to do something like this
gt; =IF(A1=quot;yesquot;,VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FAL SE)
gt; 20%,VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)
gt;
gt; basically if A1 is yes, then vlookup the value in products plus 20%, if A1
gt; is not yes then just return the vlookup value
gt;
gt; Thanks!
gt;
gt; quot;Pete_UKquot; gt; wrote in message
gt; ups.com...
gt; gt; Yes,you can use VLOOKUP( ) within an IF statement. Tell us what you
gt; gt; want to do and we might be able to help further.
gt; gt;
gt; gt; Pete
gt; gt;

--

Dave Peterson

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.

Petecan you give me an example of the whole formula please

quot;Pete_UKquot; gt; wrote in message oups.com...
gt; Yes, you can't just add 20% to the value returned by the vlookup as you
gt; are trying to do, you have to multiply this value by 1.2 (i.e. 120%) as
gt; Dave suggests.
gt;
gt; Pete
gt;
Ok, copying yours down from above:

=IF(A1=quot;yesquot;,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.

Petethanks!

quot;Pete_UKquot; gt; wrote in message oups.com...
gt; Ok, copying yours down from above:
gt;
gt; =IF(A1=quot;yesquot;,VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FAL SE)*1.2,
gt; VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE))
gt;
gt; You had missed off a bracket at the end.
gt;
gt; Hope this helps.
gt;
gt; Pete
gt;
You're welcome.

PeteI think I would have used:

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

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

Alec Green wrote:
gt;
gt; can you give me an example of the whole formula please
gt;
gt; quot;Pete_UKquot; gt; wrote in message
gt; oups.com...
gt; gt; Yes, you can't just add 20% to the value returned by the vlookup as you
gt; gt; are trying to do, you have to multiply this value by 1.2 (i.e. 120%) as
gt; gt; Dave suggests.
gt; gt;
gt; gt; Pete
gt; gt;

--

Dave Peterson

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()