Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 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" a écrit dans le message de news:
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup Multiple Matches RoadKill Excel Worksheet Functions 4 February 6th 09 01:59 AM
VLOOKUP and multiple matches tamz33 Excel Discussion (Misc queries) 2 August 14th 07 07:10 PM
How do I get multiple matches when using the Vlookup function? Lisa F Excel Worksheet Functions 1 February 27th 06 11:17 PM
Multiple matches on VLOOKUP [email protected] Excel Worksheet Functions 2 May 9th 05 05:15 PM
Vlookup with multiple matches BubBob[_4_] Excel Programming 1 September 8th 03 07:21 AM


All times are GMT +1. The time now is 08:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"