#1   Report Post  
JN
 
Posts: n/a
Default Excel formulas

I need to calculate a sum using 2 different date ranges...example

Col A Col B
11/29/04 500
11/30/04 2
12/01/04 600
12/02/04 300

I cannot get SUMPRODUCT to work as it will only calc <=11/30/04 or
<=12/02/04 but not both. The sum I am looking for would be Nov04=502 and
Dec04=900.
Does this make sense or is it hopeless?

  #2   Report Post  
Domenic
 
Posts: n/a
Default

Try...

=SUMPRODUCT(--(A1:A4="12/1/2004"+0),--(A1:A4<="12/31/2004"+0),B1:B4)

or

=SUMPRODUCT(--(A1:A4=C1),--(A1:A4<=D1),B1:B4)

....where C1 contains the start date, and D1 contains the end date.

Hope this helps!

In article ,
"JN" wrote:

I need to calculate a sum using 2 different date ranges...example

Col A Col B
11/29/04 500
11/30/04 2
12/01/04 600
12/02/04 300

I cannot get SUMPRODUCT to work as it will only calc <=11/30/04 or
<=12/02/04 but not both. The sum I am looking for would be Nov04=502 and
Dec04=900.
Does this make sense or is it hopeless?

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


"Domenic" wrote in message
...
Try...

=SUMPRODUCT(--(A1:A4="12/1/2004"+0),--(A1:A4<="12/31/2004"+0),B1:B4)


or even

=SUMPRODUCT(--(A1:A4=--"2004-01-12"),--(A1:A4<=--"2004-01-31"),B1:B4)

with no nasty +0, and internationally standard dates :-)


  #4   Report Post  
Domenic
 
Posts: n/a
Default

In article ,
"Bob Phillips" wrote:

=SUMPRODUCT(--(A1:A4=--"2004-01-12"),--(A1:A4<=--"2004-01-31"),B1:B4)

with no nasty +0, and internationally standard dates :-)


Actually, for some reason, I find +0 more appealing to the eyes. Just a
personal preference. :)

And, yes, good point about using internationally standard dates. Should
eliminate any confusion.
  #5   Report Post  
JN
 
Posts: n/a
Default

Thank you so much!!! Could I beg you to help with another?

Col C Col E Col G
VA3 LAN 1
V4P V4P 2
V4P LNS 3

I need to get it to look at both Col C & Col E and, if the criteria matches,
total G (in the example, the sum would be 5). The criteria being V4P in Col
C and V4P OR LNS in Col E. I can get it to work for one or the other
SUMPRODUCT((C1:C3="V4P")*(E1:E3="???"),(G1:G3)) where ??? is either V4P or
LNS but I cannot get it to look for both and total it.


"Domenic" wrote:

In article ,
"Bob Phillips" wrote:

=SUMPRODUCT(--(A1:A4=--"2004-01-12"),--(A1:A4<=--"2004-01-31"),B1:B4)

with no nasty +0, and internationally standard dates :-)


Actually, for some reason, I find +0 more appealing to the eyes. Just a
personal preference. :)

And, yes, good point about using internationally standard dates. Should
eliminate any confusion.



  #6   Report Post  
JN
 
Posts: n/a
Default

Wonderful! Thanks so much for helping! Could I bother you for help one more
time?

Col C Col E Col G
VA1 XYZ 1
V4P V4P 2
V4P LNS 3
VA2 VA2 7

I am looking for Excel to look at Col C and Col E and, if the criteria is
correct, get totals from Col G. I used
SUMPRODUCT((C1:C4="V4P")*(E1:E4="???"),(G1:G4)) where ??? criteria is V4P or
LNS. This will work for each (V4P or LNS) but I need it to look at both.
The sum would 5 in the above example.

"Domenic" wrote:

Try...

=SUMPRODUCT(--(A1:A4="12/1/2004"+0),--(A1:A4<="12/31/2004"+0),B1:B4)

or

=SUMPRODUCT(--(A1:A4=C1),--(A1:A4<=D1),B1:B4)

....where C1 contains the start date, and D1 contains the end date.

Hope this helps!

In article ,
"JN" wrote:

I need to calculate a sum using 2 different date ranges...example

Col A Col B
11/29/04 500
11/30/04 2
12/01/04 600
12/02/04 300

I cannot get SUMPRODUCT to work as it will only calc <=11/30/04 or
<=12/02/04 but not both. The sum I am looking for would be Nov04=502 and
Dec04=900.
Does this make sense or is it hopeless?


  #7   Report Post  
Dave Peterson
 
Posts: n/a
Default

How about:
=SUMPRODUCT((C1:C4="V4P")*(E1:E4={"xyz","v4p"})*(G 1:G4))



JN wrote:

Wonderful! Thanks so much for helping! Could I bother you for help one more
time?

Col C Col E Col G
VA1 XYZ 1
V4P V4P 2
V4P LNS 3
VA2 VA2 7

I am looking for Excel to look at Col C and Col E and, if the criteria is
correct, get totals from Col G. I used
SUMPRODUCT((C1:C4="V4P")*(E1:E4="???"),(G1:G4)) where ??? criteria is V4P or
LNS. This will work for each (V4P or LNS) but I need it to look at both.
The sum would 5 in the above example.

"Domenic" wrote:

Try...

=SUMPRODUCT(--(A1:A4="12/1/2004"+0),--(A1:A4<="12/31/2004"+0),B1:B4)

or

=SUMPRODUCT(--(A1:A4=C1),--(A1:A4<=D1),B1:B4)

....where C1 contains the start date, and D1 contains the end date.

Hope this helps!

In article ,
"JN" wrote:

I need to calculate a sum using 2 different date ranges...example

Col A Col B
11/29/04 500
11/30/04 2
12/01/04 600
12/02/04 300

I cannot get SUMPRODUCT to work as it will only calc <=11/30/04 or
<=12/02/04 but not both. The sum I am looking for would be Nov04=502 and
Dec04=900.
Does this make sense or is it hopeless?



--

Dave Peterson
  #8   Report Post  
JN
 
Posts: n/a
Default

You have saved my life! Thanks!!!!

"Dave Peterson" wrote:

How about:
=SUMPRODUCT((C1:C4="V4P")*(E1:E4={"xyz","v4p"})*(G 1:G4))



JN wrote:

Wonderful! Thanks so much for helping! Could I bother you for help one more
time?

Col C Col E Col G
VA1 XYZ 1
V4P V4P 2
V4P LNS 3
VA2 VA2 7

I am looking for Excel to look at Col C and Col E and, if the criteria is
correct, get totals from Col G. I used
SUMPRODUCT((C1:C4="V4P")*(E1:E4="???"),(G1:G4)) where ??? criteria is V4P or
LNS. This will work for each (V4P or LNS) but I need it to look at both.
The sum would 5 in the above example.

"Domenic" wrote:

Try...

=SUMPRODUCT(--(A1:A4="12/1/2004"+0),--(A1:A4<="12/31/2004"+0),B1:B4)

or

=SUMPRODUCT(--(A1:A4=C1),--(A1:A4<=D1),B1:B4)

....where C1 contains the start date, and D1 contains the end date.

Hope this helps!

In article ,
"JN" wrote:

I need to calculate a sum using 2 different date ranges...example

Col A Col B
11/29/04 500
11/30/04 2
12/01/04 600
12/02/04 300

I cannot get SUMPRODUCT to work as it will only calc <=11/30/04 or
<=12/02/04 but not both. The sum I am looking for would be Nov04=502 and
Dec04=900.
Does this make sense or is it hopeless?


--

Dave Peterson

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
I want Excel to allow cells with formulas and unrelated text blueboy Excel Discussion (Misc queries) 9 March 4th 05 12:22 AM
Suddenly cannot calculate functions or formulas in Excel Leon Hairie Excel Worksheet Functions 1 March 1st 05 04:26 PM
How do I save a copy of an excel file without the formulas? Saving Excel File without Formula Excel Worksheet Functions 1 February 14th 05 08:55 PM
IF/AND formulas within excel mark.ew Excel Discussion (Misc queries) 5 January 4th 05 07:12 PM
Problems with Excel formulas when 2002 upgraded to XP Kathi McGraw Excel Worksheet Functions 0 November 16th 04 05:27 PM


All times are GMT +1. The time now is 09:11 AM.

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"