Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Sumif a date time colum and information

I am wanting to sumif a series of date times in a colum and sum another colum
with $ values
eg
A B
21-1-2008 07:30 $500
26-1-2009 04:00 $200
Wanting to sum if the datetime field relates to "2009"
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 230
Default Sumif a date time colum and information

One way:

=SUMPRODUCT(--(YEAR(A1:A100)=2009)*B1:B100)
Adjust the range to suit but make sure both ranges are exactly the same no
of rows!
You could also make the 2009 part a reference to a cell in which you enter
the year for ease sake; eg
=SUMPRODUCT(--(YEAR(A1:A100)=C1)*B1:B100) Then you can enter 2009 or 2008,
etc in cell C1.

Rob

"JMB" wrote in message
...
I am wanting to sumif a series of date times in a colum and sum another
colum
with $ values
eg
A B
21-1-2008 07:30 $500
26-1-2009 04:00 $200
Wanting to sum if the datetime field relates to "2009"



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Sumif a date time colum and information

If the dates/times are true Excel dates/times:

=SUMPRODUCT(--(YEAR(A1:A10)=2009),B1:B10)

If the dates/times are text strings:

=SUMPRODUCT(--(ISNUMBER(FIND(2009,A1:A10))),B1:B10)


--
Biff
Microsoft Excel MVP


"JMB" wrote in message
...
I am wanting to sumif a series of date times in a colum and sum another
colum
with $ values
eg
A B
21-1-2008 07:30 $500
26-1-2009 04:00 $200
Wanting to sum if the datetime field relates to "2009"



  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Sumif a date time colum and information

One way: =SUMPRODUCT((YEAR(A2:A10)=2009)*B2:B10)
which assumes real date/times in col A
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"JMB" wrote:
I am wanting to sumif a series of date times in a colum and sum another colum
with $ values
eg
A B
21-1-2008 07:30 $500
26-1-2009 04:00 $200
Wanting to sum if the datetime field relates to "2009"

  #5   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Sumif a date time colum and information

Think the double minus "--" is not necessary if you're multiplying it direct
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---




  #6   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Sumif a date time colum and information

That works fine, is there also a way that you could do the same thing only
monthly by year.

"Max" wrote:

One way: =SUMPRODUCT((YEAR(A2:A10)=2009)*B2:B10)
which assumes real date/times in col A
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"JMB" wrote:
I am wanting to sumif a series of date times in a colum and sum another colum
with $ values
eg
A B
21-1-2008 07:30 $500
26-1-2009 04:00 $200
Wanting to sum if the datetime field relates to "2009"

  #7   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Sumif a date time colum and information

"JMB" wrote:
That works fine, is there also a way that you could
do the same thing only monthly by year.


Sure, something like this:
=SUMPRODUCT((TEXT(A2:A10,"mmmyyyy")="Jan2009")*B2: B10)

Do take a moment to press the "Yes" button below to the question:
"Was this post helpful to you?" from where you're reading this.
It'll ensure a longer shelf life to this thread for the general benefit
of other readers.
--
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
Insert new colum, without changing information Penny Excel Worksheet Functions 1 April 19th 07 11:51 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM
How do place a column of date/time information into a calendar for Linuxster Excel Discussion (Misc queries) 0 December 3rd 05 12:56 AM
SUMIF other related field contains certain information Sunantoro Excel Discussion (Misc queries) 3 September 19th 05 10:01 AM
Help - Information with time and date PM Excel Discussion (Misc queries) 4 January 6th 05 08:25 AM


All times are GMT +1. The time now is 12:51 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"