Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Sum function based on Date recognition

Hello there, I am trying to do a vlookup type function which will recognise
dates within a range (ie per month) and then do a sum function on another
column. Is it possible to do this, or do I need to write a macro? If I need a
macro how would I go about formuling the code?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 718
Default Sum function based on Date recognition

Say you have dates in A1:A10, and amounts in B1:B10

You can write:
=SUMPRODUCT((MONTH(A1:A10)=7)*B1:B10)

to get the summation of all amounts pertaining to the month of july

HTH
--
AP

"Cammy" a écrit dans le message de news:
...
Hello there, I am trying to do a vlookup type function which will
recognise
dates within a range (ie per month) and then do a sum function on another
column. Is it possible to do this, or do I need to write a macro? If I
need a
macro how would I go about formuling the code?



  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Sum function based on Date recognition

"Cammy" wrote:
Hello there, I am trying to do a vlookup type function which will recognise
dates within a range (ie per month) and then do a sum function on another
column. Is it possible to do this, or do I need to write a macro? If I need a
macro how would I go about formuling the code?


Try something like this in say, C1:
=SUMPRODUCT(($A$2:$A$100= -- "1-Jun-2006")*($A$2:$A$100<= --
"15-Jun-2006"),$B$2:$B$100)

assuming real dates are within $A$2:$A$100,
with values to be summed in $B$2:$B$100

Adapt to suit, but note that entire col references, eg: A:A, B:B, cannot be
used in SUMPRODUCT
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Sum function based on Date recognition

Thanks that is exactly what I needed.

"Max" wrote:

"Cammy" wrote:
Hello there, I am trying to do a vlookup type function which will recognise
dates within a range (ie per month) and then do a sum function on another
column. Is it possible to do this, or do I need to write a macro? If I need a
macro how would I go about formuling the code?


Try something like this in say, C1:
=SUMPRODUCT(($A$2:$A$100= -- "1-Jun-2006")*($A$2:$A$100<= --
"15-Jun-2006"),$B$2:$B$100)

assuming real dates are within $A$2:$A$100,
with values to be summed in $B$2:$B$100

Adapt to suit, but note that entire col references, eg: A:A, B:B, cannot be
used in SUMPRODUCT
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

  #5   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Sum function based on Date recognition

"Cammy" wrote:
Thanks that is exactly what I needed.


Glad to hear that, Cammy !
Thanks for the feedback ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
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
Conditional formatting based on date range RGB Excel Discussion (Misc queries) 3 May 23rd 06 05:37 PM
Power users need your help €“ calculation based on a date General X Excel Worksheet Functions 1 May 22nd 06 03:42 PM
Bucketing data based on DATE Range criteria sumitk Excel Discussion (Misc queries) 1 May 20th 06 12:16 AM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
"NOW" or "TODAY" date function Chris Excel Worksheet Functions 2 April 19th 06 07:46 PM


All times are GMT +1. The time now is 08:53 PM.

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

About Us

"It's about Microsoft Excel"