#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default 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


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
Help with looping dok112[_55_] Excel Programming 0 November 1st 05 05:09 PM
Not Looping Through teresa Excel Programming 2 June 5th 05 10:33 PM
Looping teresa Excel Programming 2 May 31st 05 01:40 AM
Looping Andrew Clark[_2_] Excel Programming 1 December 20th 03 05:01 PM
Looping Syd[_4_] Excel Programming 1 December 11th 03 11:17 PM


All times are GMT +1. The time now is 04:09 PM.

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"