+ Reply to Thread
Results 1 to 3 of 3

Comparison Function

  1. #1
    DifficultyInExcel-ing
    Guest

    Comparison Function

    I want to compare data on one sheet with data on another sheet (within the
    same file) and then populate cells with data from that other sheet. For
    example:

    Column B (Sheet 1) has data that may have duplicate data from Column A
    (Sheet 2). If so, I want to copy the data from Column B (Sheet 2) to Column
    E (Sheet 1).

    Can someone help me figure out which function(s) to use and how to formulate
    the logical sequence?

    Thanks!

  2. #2
    bpeltzer
    Guest

    RE: Comparison Function

    The basic test to pull data from one table based on a matching value earlier
    in the same row is a vlookup. To produce a null result when there's no
    match, you'd embed that inside an if function. And the formula will always
    go in the cell where the result should appear.
    So enter a formula in sheet 1, cell E2:
    =if(isna(vlookup(b2,Sheet2!A:B,2,0)),"",vlookup(b2,Sheet2!A:B,2,0))
    You could copy that formula down to as many rows of column E as you need.
    (You might first enter just the vlookup part: =vlookup(b2,Sheet2!A:B,2,0)
    then Insert > Function and see what the dialog tells you about the arguments
    of the vlookup function).

    "DifficultyInExcel-ing" wrote:

    > I want to compare data on one sheet with data on another sheet (within the
    > same file) and then populate cells with data from that other sheet. For
    > example:
    >
    > Column B (Sheet 1) has data that may have duplicate data from Column A
    > (Sheet 2). If so, I want to copy the data from Column B (Sheet 2) to Column
    > E (Sheet 1).
    >
    > Can someone help me figure out which function(s) to use and how to formulate
    > the logical sequence?
    >
    > Thanks!


  3. #3
    DifficultyInExcel-ing
    Guest

    RE: Comparison Function

    Thanks so much for your help on this. It's really a time saver! --

    "bpeltzer" wrote:

    > The basic test to pull data from one table based on a matching value earlier
    > in the same row is a vlookup. To produce a null result when there's no
    > match, you'd embed that inside an if function. And the formula will always
    > go in the cell where the result should appear.
    > So enter a formula in sheet 1, cell E2:
    > =if(isna(vlookup(b2,Sheet2!A:B,2,0)),"",vlookup(b2,Sheet2!A:B,2,0))
    > You could copy that formula down to as many rows of column E as you need.
    > (You might first enter just the vlookup part: =vlookup(b2,Sheet2!A:B,2,0)
    > then Insert > Function and see what the dialog tells you about the arguments
    > of the vlookup function).
    >
    > "DifficultyInExcel-ing" wrote:
    >
    > > I want to compare data on one sheet with data on another sheet (within the
    > > same file) and then populate cells with data from that other sheet. For
    > > example:
    > >
    > > Column B (Sheet 1) has data that may have duplicate data from Column A
    > > (Sheet 2). If so, I want to copy the data from Column B (Sheet 2) to Column
    > > E (Sheet 1).
    > >
    > > Can someone help me figure out which function(s) to use and how to formulate
    > > the logical sequence?
    > >
    > > Thanks!


+ 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