Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default sum if dates conditional

I have a spreadsheet with two columns:
H contains dates and J contains x's.

The dates go from May to December. I have figured out the days that each
month starts and ends. So, I want to sum up all rows with an x and in between
two dates. For this, I have

=SUM(IF(All!J3:J214="x",IF(AND(DATE(YEAR(A48),MONT H(A48),DAY(M49))=All!J3:J214,DATE(YEAR(A48),MONTH (A48),DAY(N49))<=All!J3:J214),"1","0")))

But that just gives 0. Any ideas?

-Benjamin

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default sum if dates conditional

=SUMPRODUCT(--(All!J3:J214="x"),--(DATE(YEAR(A48),MONTH(A48),DAY(M49))=All!
J3:J214),--(DATE(YEAR(A48),MONTH(A48),DAY(N49))<=All!J3:J214) )

--

HTH

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


"benjo4u" wrote in message
...
I have a spreadsheet with two columns:
H contains dates and J contains x's.

The dates go from May to December. I have figured out the days that each
month starts and ends. So, I want to sum up all rows with an x and in

between
two dates. For this, I have


=SUM(IF(All!J3:J214="x",IF(AND(DATE(YEAR(A48),MONT H(A48),DAY(M49))=All!J3:J
214,DATE(YEAR(A48),MONTH(A48),DAY(N49))<=All!J3:J2 14),"1","0")))

But that just gives 0. Any ideas?

-Benjamin



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default sum if dates conditional

I had made a mistake in typing it in (wrong columns), but even with your new
formula it still doesn't work.

=SUMPRODUCT(--(All!J2:J214="x"),--(DATE(YEAR(A47),MONTH(A47),DAY(M48))=All!H2:H214) ,--(DATE(YEAR(A47),MONTH(A47),DAY(N48))<=All!H2:H214) )

the date column is formatted as date...

-Benjamin

"Bob Phillips" wrote:

=SUMPRODUCT(--(All!J3:J214="x"),--(DATE(YEAR(A48),MONTH(A48),DAY(M49))=All!
J3:J214),--(DATE(YEAR(A48),MONTH(A48),DAY(N49))<=All!J3:J214) )

--

HTH

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


"benjo4u" wrote in message
...
I have a spreadsheet with two columns:
H contains dates and J contains x's.

The dates go from May to December. I have figured out the days that each
month starts and ends. So, I want to sum up all rows with an x and in

between
two dates. For this, I have


=SUM(IF(All!J3:J214="x",IF(AND(DATE(YEAR(A48),MONT H(A48),DAY(M49))=All!J3:J
214,DATE(YEAR(A48),MONTH(A48),DAY(N49))<=All!J3:J2 14),"1","0")))

But that just gives 0. Any ideas?

-Benjamin




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default sum if dates conditional

What do you get?

--

HTH

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


"benjo4u" wrote in message
...
I had made a mistake in typing it in (wrong columns), but even with your

new
formula it still doesn't work.


=SUMPRODUCT(--(All!J2:J214="x"),--(DATE(YEAR(A47),MONTH(A47),DAY(M48))=All!
H2:H214),--(DATE(YEAR(A47),MONTH(A47),DAY(N48))<=All!H2:H214) )

the date column is formatted as date...

-Benjamin

"Bob Phillips" wrote:


=SUMPRODUCT(--(All!J3:J214="x"),--(DATE(YEAR(A48),MONTH(A48),DAY(M49))=All!
J3:J214),--(DATE(YEAR(A48),MONTH(A48),DAY(N49))<=All!J3:J214) )

--

HTH

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


"benjo4u" wrote in message
...
I have a spreadsheet with two columns:
H contains dates and J contains x's.

The dates go from May to December. I have figured out the days that

each
month starts and ends. So, I want to sum up all rows with an x and in

between
two dates. For this, I have



=SUM(IF(All!J3:J214="x",IF(AND(DATE(YEAR(A48),MONT H(A48),DAY(M49))=All!J3:J
214,DATE(YEAR(A48),MONTH(A48),DAY(N49))<=All!J3:J2 14),"1","0")))

But that just gives 0. Any ideas?

-Benjamin






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default sum if dates conditional

I have encountered the same problem, so I added columns to my original
dataset that separate the date into Month, Day and Year, and then added
conditions to the SUMPRODUCT formula accordingly.

I believe that the date functions cannot be analyzed in an array (at
least that is what I have been told, and it seems to be true). I use
Excel 2000 on Windows XP.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default sum if dates conditional

Don't know if this would help -
but I just finished setting up some formulas for a friend.
The formulas did a SumIf. The ranges were determined using the Indirect
function.
The data condition(s) were created by separating the date out of the column
header.
The headers were "Text" "Date"

This was used to summarize data from many sheets onto a master sheet.

If you think this would help - let me know...

(you could also use this in a SumProduct formula)

--
steveB

Remove "AYN" from email to respond
"gpie" wrote in message
oups.com...
I have encountered the same problem, so I added columns to my original
dataset that separate the date into Month, Day and Year, and then added
conditions to the SUMPRODUCT formula accordingly.

I believe that the date functions cannot be analyzed in an array (at
least that is what I have been told, and it seems to be true). I use
Excel 2000 on Windows XP.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default sum if dates conditional

Not correct, we do it all the time in responses here.

--

HTH

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


"gpie" wrote in message
oups.com...
I have encountered the same problem, so I added columns to my original
dataset that separate the date into Month, Day and Year, and then added
conditions to the SUMPRODUCT formula accordingly.

I believe that the date functions cannot be analyzed in an array (at
least that is what I have been told, and it seems to be true). I use
Excel 2000 on Windows XP.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default sum if dates conditional

another question: given that
=SUMPRODUCT(--(All!L2:L5000="x"),--(M49<=All!H2:H5000),--(N49=All!H2:H5000))

works to count the number of entries, how can I sum up dollaramounts within
the same date periods (bordered by m49 and n49)

thanks
-Benjamin
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 dates Cindyt Excel Discussion (Misc queries) 2 March 5th 10 07:05 PM
using conditional formatting with dates Josh Excel Worksheet Functions 1 December 3rd 09 10:07 PM
conditional formating using dates jorgie Excel Worksheet Functions 3 August 23rd 06 08:06 AM
conditional formatting using dates creynolds Excel Discussion (Misc queries) 1 August 8th 06 12:30 AM
conditional formating: dates steely Excel Worksheet Functions 1 October 20th 05 11:20 AM


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