Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jnorton
 
Posts: n/a
Default Sum if certain criteria is met

I have a column with dates in it (Jan-12-2004) I have another column with the
transaction price in it like $21.95.

I need to sum the column by month. I can do mid(Jan-12-2004,1,3) to take out
the info except Jan but then how do you sum from that point on.

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

You could use

=SUMPRODUCT(--(MONTH(A1:A100)=1),B1:B100)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"jnorton" wrote in message
...
I have a column with dates in it (Jan-12-2004) I have another column with

the
transaction price in it like $21.95.

I need to sum the column by month. I can do mid(Jan-12-2004,1,3) to take

out
the info except Jan but then how do you sum from that point on.



  #3   Report Post  
jnorton
 
Posts: n/a
Default

let me add a sample

Sheet 1
A B
Dec-14-2004 40.56
Dec-14-2004 119.97
Dec-14-2004 120.54
Dec-15-2004 -33.42
Dec-15-2004 121.04
Dec-15-2004 -40.36
Dec-16-2004 32.83
Dec-16-2004 32.79
Dec-16-2004 39.66
Dec-20-2004 32.13
Dec-20-2005 119.52
Dec-20-2006 119.04
Dec-20-2007 -39.48
Dec-20-2007 119.04
Dec-21-2005 120.95
Dec-22-2004 120.39
Dec-22-2004 -39.75
Dec-22-2004 33.05
Dec-23-2004 120.5
Dec-23-2004 -32.86
Dec-27-2004 32.81
Dec-27-2004 39.8
Dec-27-2004 121.74
Dec-27-2004 121.49
Dec-28-2004 -32.7
Dec-28-2004 39.65
Dec-28-2004 33.29
Dec-28-2004 -40.14
Jan-03-2005 38.85
Jan-03-2005 31.89
Jan-03-2005 119.2
Jan-03-2005 116.66
Jan-04-2005 38.74
Jan-05-2005 38.58
Jan-05-2005 31.34
Jan-05-2005 118.89
Jan-06-2005 38.76
Jan-06-2005 116.55
Jan-06-2005 119.06
Jan-06-2005 31.78
Jan-07-2005 38.7
Jan-07-2005 118.59
Jan-07-2005 31.57
Jan-07-2005 116.19
Jan-07-2005 119.11
Jan-07-2005 117.04
Jan-10-2005 31.07
Jan-10-2005 38.33
Jan-10-2005 118.34
Jan-10-2005 116.46
Jan-11-2005 31.2
Jan-11-2005 115.92

Sheet2
A B
Dec Jan
X y

I need only the positive values for X and Y from sheet one and the sum needs
to be placed in the corrosponing month colum on sheet two
"Bob Phillips" wrote:

You could use

=SUMPRODUCT(--(MONTH(A1:A100)=1),B1:B100)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"jnorton" wrote in message
...
I have a column with dates in it (Jan-12-2004) I have another column with

the
transaction price in it like $21.95.

I need to sum the column by month. I can do mid(Jan-12-2004,1,3) to take

out
the info except Jan but then how do you sum from that point on.




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

=SUMPRODUCT(--(TEXT(Sheet1!A1:A100,"mmm")=A1),--(Sheet1!B1:B1000),Sheet1!B1
:B100)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"jnorton" wrote in message
...
let me add a sample

Sheet 1
A B
Dec-14-2004 40.56
Dec-14-2004 119.97
Dec-14-2004 120.54
Dec-15-2004 -33.42
Dec-15-2004 121.04
Dec-15-2004 -40.36
Dec-16-2004 32.83
Dec-16-2004 32.79
Dec-16-2004 39.66
Dec-20-2004 32.13
Dec-20-2005 119.52
Dec-20-2006 119.04
Dec-20-2007 -39.48
Dec-20-2007 119.04
Dec-21-2005 120.95
Dec-22-2004 120.39
Dec-22-2004 -39.75
Dec-22-2004 33.05
Dec-23-2004 120.5
Dec-23-2004 -32.86
Dec-27-2004 32.81
Dec-27-2004 39.8
Dec-27-2004 121.74
Dec-27-2004 121.49
Dec-28-2004 -32.7
Dec-28-2004 39.65
Dec-28-2004 33.29
Dec-28-2004 -40.14
Jan-03-2005 38.85
Jan-03-2005 31.89
Jan-03-2005 119.2
Jan-03-2005 116.66
Jan-04-2005 38.74
Jan-05-2005 38.58
Jan-05-2005 31.34
Jan-05-2005 118.89
Jan-06-2005 38.76
Jan-06-2005 116.55
Jan-06-2005 119.06
Jan-06-2005 31.78
Jan-07-2005 38.7
Jan-07-2005 118.59
Jan-07-2005 31.57
Jan-07-2005 116.19
Jan-07-2005 119.11
Jan-07-2005 117.04
Jan-10-2005 31.07
Jan-10-2005 38.33
Jan-10-2005 118.34
Jan-10-2005 116.46
Jan-11-2005 31.2
Jan-11-2005 115.92

Sheet2
A B
Dec Jan
X y

I need only the positive values for X and Y from sheet one and the sum

needs
to be placed in the corrosponing month colum on sheet two
"Bob Phillips" wrote:

You could use

=SUMPRODUCT(--(MONTH(A1:A100)=1),B1:B100)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"jnorton" wrote in message
...
I have a column with dates in it (Jan-12-2004) I have another column

with
the
transaction price in it like $21.95.

I need to sum the column by month. I can do mid(Jan-12-2004,1,3) to

take
out
the info except Jan but then how do you sum from that point on.






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
Max value that meets a criteria David Burr Excel Worksheet Functions 6 February 16th 05 01:31 PM
SUM IF Criteria stacey Excel Worksheet Functions 3 December 31st 04 12:22 AM
SUMIF with more than 1 criteria Mike@Q Excel Worksheet Functions 4 November 26th 04 12:17 AM
Counting "rows", i.e. simultaneous criteria for multiple cells gkline Excel Worksheet Functions 2 November 19th 04 07:30 AM
Can I use a cell reference in the criteria for the sumif function. Number Cruncher Excel Worksheet Functions 2 November 4th 04 07:52 PM


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