ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Hybrid vlookup - sum function (https://www.excelbanter.com/excel-worksheet-functions/202894-hybrid-vlookup-sum-function.html)

Emeryville John

Hybrid vlookup - sum function
 
Hi,

I have two tables that each have 2 columns. The first column in the first
table is composed of dates that are in ascending order, but have some
duplicate dates and missing dates. The second column has numbered values. The
first column in the second a table is all dates 1/1/08 to present. I want the
second column to be an output of a function. The first part of the function
is easy and would find a date in the first table and return the corresponding
column 2 value. The tricky part is that when there are two dates, or more
than one, then I want the output be the sum of the column 2 values. Does this
make sense? Thanks for your help.

John

Peo Sjoblom[_2_]

Hybrid vlookup - sum function
 
=SUMIF($A$2:$A$100=D2,$B$2:$B$100)


where A2:B100 is the first table that you want to total and D2 is the first
cell in the second table

copy down
--


Regards,


Peo Sjoblom

"Emeryville John" wrote in
message ...
Hi,

I have two tables that each have 2 columns. The first column in the first
table is composed of dates that are in ascending order, but have some
duplicate dates and missing dates. The second column has numbered values.
The
first column in the second a table is all dates 1/1/08 to present. I want
the
second column to be an output of a function. The first part of the
function
is easy and would find a date in the first table and return the
corresponding
column 2 value. The tricky part is that when there are two dates, or more
than one, then I want the output be the sum of the column 2 values. Does
this
make sense? Thanks for your help.

John




Dave Peterson

Hybrid vlookup - sum function
 
Typo alert:

=SUMIF($A$2:$A$100,D2,$B$2:$B$100)

(equal sign changed to a comma)

Peo Sjoblom wrote:

=SUMIF($A$2:$A$100=D2,$B$2:$B$100)

where A2:B100 is the first table that you want to total and D2 is the first
cell in the second table

copy down
--

Regards,

Peo Sjoblom

"Emeryville John" wrote in
message ...
Hi,

I have two tables that each have 2 columns. The first column in the first
table is composed of dates that are in ascending order, but have some
duplicate dates and missing dates. The second column has numbered values.
The
first column in the second a table is all dates 1/1/08 to present. I want
the
second column to be an output of a function. The first part of the
function
is easy and would find a date in the first table and return the
corresponding
column 2 value. The tricky part is that when there are two dates, or more
than one, then I want the output be the sum of the column 2 values. Does
this
make sense? Thanks for your help.

John


--

Dave Peterson


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com