+ Reply to Thread
Results 1 to 3 of 3

Excel macro/function like VLOOKUP that sums eventual multiple matches

  1. #1
    Mary
    Guest

    Excel macro/function like VLOOKUP that sums eventual multiple matches

    How can I create an Excel command (macro or function) that works like the
    VLOOKUP function but sums eventual multiple matches?

    Example:

    Sheet1 - before execution:
    DOG | WHITE
    HOUSE | YELLOW
    CAT | GRAY

    Sheet2 - before execution:
    HOUSE | 300
    DOG | 780
    DOG | 200
    BALL | 560

    Sheet1 - AFTER execution:
    DOG | WHITE | 980
    HOUSE | YELLOW | 300
    CAT | GRAY |



  2. #2
    Ardus Petus
    Guest

    Re: Excel macro/function like VLOOKUP that sums eventual multiple matches

    =SUMIF(Sheet2!A1:A999,A1,Sheet2:B1:B999)

    This formula is to be coded in Sheet1, cell C1.
    Then copied down

    HTH
    --
    AP

    "Mary" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > How can I create an Excel command (macro or function) that works like the
    > VLOOKUP function but sums eventual multiple matches?
    >
    > Example:
    >
    > Sheet1 - before execution:
    > DOG | WHITE
    > HOUSE | YELLOW
    > CAT | GRAY
    >
    > Sheet2 - before execution:
    > HOUSE | 300
    > DOG | 780
    > DOG | 200
    > BALL | 560
    >
    > Sheet1 - AFTER execution:
    > DOG | WHITE | 980
    > HOUSE | YELLOW | 300
    > CAT | GRAY |
    >
    >




  3. #3
    Jim Thomlinson
    Guest

    RE: Excel macro/function like VLOOKUP that sums eventual multiple matc

    Take a look at the sumproduct formula. Here is a link that explains it...

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html
    --
    HTH...

    Jim Thomlinson


    "Mary" wrote:

    > How can I create an Excel command (macro or function) that works like the
    > VLOOKUP function but sums eventual multiple matches?
    >
    > Example:
    >
    > Sheet1 - before execution:
    > DOG | WHITE
    > HOUSE | YELLOW
    > CAT | GRAY
    >
    > Sheet2 - before execution:
    > HOUSE | 300
    > DOG | 780
    > DOG | 200
    > BALL | 560
    >
    > Sheet1 - AFTER execution:
    > DOG | WHITE | 980
    > HOUSE | YELLOW | 300
    > CAT | GRAY |
    >
    >
    >


+ 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