+ Reply to Thread
Results 1 to 5 of 5

Match, Index, Vlookup, If (confused)

  1. #1
    PJS
    Guest

    Match, Index, Vlookup, If (confused)

    Hi everyone.

    I am not sure which commands to use, can someone please show me how to
    accomplish this?

    I have two different worksheets

    Worksheet 1 Worksheet 2
    Name Total Name Total
    Abe 3 John
    Bob 4 Jane
    Charlie 5 Bob

    I would like to compare the names in column A (worksheet 1) vs. the names in
    colum A (worksheet 2), if they match, in this case Bob, return the value 4 in
    worksheet 2. For John and Jane, since no matches are found, return the value
    0.

    Is this possible and what commands are needed?

    Thank you,

    Peter

  2. #2
    Damon Longworth
    Guest

    Re: Match, Index, Vlookup, If (confused)

    The Vlookup will return the values needed, but will return an NA if not
    found. The Vlookup can be wrapped in an IF(IsNa to get your 0 if not found:

    =if(isna(vlookup()),0,vlookup())

    --
    Damon Longworth

    2006 East Coast Excel User Conference
    April 19/21st, 2006
    Holiday Inn, Boardwalk
    Atlantic City, New Jersey
    Early Bird Registration Now Open!!
    www.ExcelUserConference.com

    2006 UK Excel User Conference
    Summer, 2006
    London, England
    "PJS" <PJS@discussions.microsoft.com> wrote in message
    news:9F74E833-E1A9-44F4-BDC2-AB5CF1A2D17A@microsoft.com...
    Hi everyone.

    I am not sure which commands to use, can someone please show me how to
    accomplish this?

    I have two different worksheets

    Worksheet 1 Worksheet 2
    Name Total Name Total
    Abe 3 John
    Bob 4 Jane
    Charlie 5 Bob

    I would like to compare the names in column A (worksheet 1) vs. the names in
    colum A (worksheet 2), if they match, in this case Bob, return the value 4
    in
    worksheet 2. For John and Jane, since no matches are found, return the value
    0.

    Is this possible and what commands are needed?

    Thank you,

    Peter



  3. #3
    Govind
    Guest

    Re: Match, Index, Vlookup, If (confused)

    Hi,

    Use

    =IF(ISERROR((VLOOKUP(A2,Sheet1!$A$2:$B$5,2,FALSE))),0,(VLOOKUP(A2,Sheet1!$A$2:$B$5,2,FALSE)))


    and copy it down.

    Here A2 is the cell where 'John' is in Worksheet 2.

    Regards

    Govind.


    PJS wrote:

    > Hi everyone.
    >
    > I am not sure which commands to use, can someone please show me how to
    > accomplish this?
    >
    > I have two different worksheets
    >
    > Worksheet 1 Worksheet 2
    > Name Total Name Total
    > Abe 3 John
    > Bob 4 Jane
    > Charlie 5 Bob
    >
    > I would like to compare the names in column A (worksheet 1) vs. the names in
    > colum A (worksheet 2), if they match, in this case Bob, return the value 4 in
    > worksheet 2. For John and Jane, since no matches are found, return the value
    > 0.
    >
    > Is this possible and what commands are needed?
    >
    > Thank you,
    >
    > Peter


  4. #4
    PJS
    Guest

    Re: Match, Index, Vlookup, If (confused)

    Thanks for the inputs! I appreciate it.

    "Damon Longworth" wrote:

    > The Vlookup will return the values needed, but will return an NA if not
    > found. The Vlookup can be wrapped in an IF(IsNa to get your 0 if not found:
    >
    > =if(isna(vlookup()),0,vlookup())
    >
    > --
    > Damon Longworth
    >
    > 2006 East Coast Excel User Conference
    > April 19/21st, 2006
    > Holiday Inn, Boardwalk
    > Atlantic City, New Jersey
    > Early Bird Registration Now Open!!
    > www.ExcelUserConference.com
    >
    > 2006 UK Excel User Conference
    > Summer, 2006
    > London, England
    > "PJS" <PJS@discussions.microsoft.com> wrote in message
    > news:9F74E833-E1A9-44F4-BDC2-AB5CF1A2D17A@microsoft.com...
    > Hi everyone.
    >
    > I am not sure which commands to use, can someone please show me how to
    > accomplish this?
    >
    > I have two different worksheets
    >
    > Worksheet 1 Worksheet 2
    > Name Total Name Total
    > Abe 3 John
    > Bob 4 Jane
    > Charlie 5 Bob
    >
    > I would like to compare the names in column A (worksheet 1) vs. the names in
    > colum A (worksheet 2), if they match, in this case Bob, return the value 4
    > in
    > worksheet 2. For John and Jane, since no matches are found, return the value
    > 0.
    >
    > Is this possible and what commands are needed?
    >
    > Thank you,
    >
    > Peter
    >
    >
    >


  5. #5
    PJS
    Guest

    Re: Match, Index, Vlookup, If (confused)

    Thank you very very much for the formula!


    "Govind" wrote:

    > Hi,
    >
    > Use
    >
    > =IF(ISERROR((VLOOKUP(A2,Sheet1!$A$2:$B$5,2,FALSE))),0,(VLOOKUP(A2,Sheet1!$A$2:$B$5,2,FALSE)))
    >
    >
    > and copy it down.
    >
    > Here A2 is the cell where 'John' is in Worksheet 2.
    >
    > Regards
    >
    > Govind.
    >
    >
    > PJS wrote:
    >
    > > Hi everyone.
    > >
    > > I am not sure which commands to use, can someone please show me how to
    > > accomplish this?
    > >
    > > I have two different worksheets
    > >
    > > Worksheet 1 Worksheet 2
    > > Name Total Name Total
    > > Abe 3 John
    > > Bob 4 Jane
    > > Charlie 5 Bob
    > >
    > > I would like to compare the names in column A (worksheet 1) vs. the names in
    > > colum A (worksheet 2), if they match, in this case Bob, return the value 4 in
    > > worksheet 2. For John and Jane, since no matches are found, return the value
    > > 0.
    > >
    > > Is this possible and what commands are needed?
    > >
    > > Thank you,
    > >
    > > Peter

    >


+ 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