+ Reply to Thread
Results 1 to 11 of 11

vlookup in if

  1. #1
    Alec Green
    Guest

    vlookup in if

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

    Thanks

    Alec



  2. #2
    Pete_UK
    Guest

    Re: 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. #3
    Alec Green
    Guest

    Re: 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,FALSE)
    +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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #4
    Dave Peterson
    Guest

    Re: 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,FALSE)
    > +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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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. #5
    Pete_UK
    Guest

    Re: 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. #6
    Alec Green
    Guest

    Re: vlookup in if

    can you give me an example of the whole formula please

    "Pete_UK" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #7
    Pete_UK
    Guest

    Re: vlookup in if

    Ok, copying yours down from above:

    =IF(A1="yes",VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)*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. #8
    Alec Green
    Guest

    Re: vlookup in if

    thanks!

    "Pete_UK" <[email protected]> wrote in message
    news:[email protected]...
    > Ok, copying yours down from above:
    >
    > =IF(A1="yes",VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)*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. #9
    Pete_UK
    Guest

    Re: vlookup in if

    You're welcome.

    Pete


  10. #10
    Dave Peterson
    Guest

    Re: vlookup in if

    I think I would have used:

    =VLOOKUP(G3,PRODUCTS!$A$3:$D$311,2,FALSE)*if(a1="yes",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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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. #11
    Pete_UK
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1