ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Looping (https://www.excelbanter.com/excel-programming/420961-looping.html)

LaDdIe

Looping
 
Hi,

Col A contains dates "dd/mm/yyyy"
Col B Contains values

C1 is a variable month number 1-12
D1 is a variable year

I need E1 to sum all values in Col B that match the coresponding date of
Col A based on the criteria set in C1 & D1.

Thanks.

LaDdIe



Mike H

Looping
 
Try this

=SUMPRODUCT((MONTH(A1:A20)=C1)*(YEAR(A1:A20)=D1)*( B1:B20))

Mike

"LaDdIe" wrote:

Hi,

Col A contains dates "dd/mm/yyyy"
Col B Contains values

C1 is a variable month number 1-12
D1 is a variable year

I need E1 to sum all values in Col B that match the coresponding date of
Col A based on the criteria set in C1 & D1.

Thanks.

LaDdIe



Lars-Åke Aspelin[_2_]

Looping
 
On Sun, 7 Dec 2008 07:10:01 -0800, LaDdIe
wrote:

Hi,

Col A contains dates "dd/mm/yyyy"
Col B Contains values

C1 is a variable month number 1-12
D1 is a variable year

I need E1 to sum all values in Col B that match the coresponding date of
Col A based on the criteria set in C1 & D1.

Thanks.

LaDdIe



Try this formula in cell E1:

=SUMPRODUCT((YEAR(A1:A10)=D1)*(MONTH(A1:A10)=C1)*( B1:B10))

Change the 10 in three place to cover then number of rows with data in
columns A and B.

Hope this helps / Lars-Åke

LaDdIe

Looping
 
Thanks :)

"LaDdIe" wrote:

Hi,

Col A contains dates "dd/mm/yyyy"
Col B Contains values

C1 is a variable month number 1-12
D1 is a variable year

I need E1 to sum all values in Col B that match the coresponding date of
Col A based on the criteria set in C1 & D1.

Thanks.

LaDdIe




All times are GMT +1. The time now is 03:39 PM.

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