Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Lee Lee is offline
external usenet poster
 
Posts: 38
Default Between using Sumproduct

Is there a way to enter a date value that is between 2 dates in sumproduct
or another function that will look at the same column and return the sum of
a different column? If the value is greater than May 1,2007 but less than
August 31, 2007 in column A it will return the sum of the matching rows in
column B.
I have tried this with either greater than OR less than and it works but,
when I try them in the same sumproduct() it fails.
Thanks for reading and any information to the right direction.

--
Lee Coleman


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,268
Default Between using Sumproduct

=SUMPRODUCT(--(A2:A500=DATE(2007,5,1)),--(A2:A500<=DATE(2007,8,31)),B2:B500)


note that I included May 1st and August 31st since that is what I believe
you wanted, if not change the

<=
=


to
<


You can also use

=SUMIF(A2:A500,"="&DATE(2007,5,1),B2:B500)-SUMIF(A2:A500,""&DATE(2007,8,31),B2:B500)

which is probably a bit more efficient if you have a lot of cells to sum


--


Regards,


Peo Sjoblom



"Lee" wrote in message
...
Is there a way to enter a date value that is between 2 dates in sumproduct
or another function that will look at the same column and return the sum
of a different column? If the value is greater than May 1,2007 but less
than August 31, 2007 in column A it will return the sum of the matching
rows in column B.
I have tried this with either greater than OR less than and it works but,
when I try them in the same sumproduct() it fails.
Thanks for reading and any information to the right direction.

--
Lee Coleman




  #3   Report Post  
Posted to microsoft.public.excel.newusers
Lee Lee is offline
external usenet poster
 
Posts: 38
Default Between using Sumproduct

I am confused about the Date because the accounting program exports the
invoice date in MMDDYYYY. Will this work with the YYYYMD format that you
have here or do I need to change one of the formats? And it is alot of rows
and I am grateful for Excel 2007 that can handle the 95,000+ rows on one
worksheet.
Thank you for the feedback.
Lee

"Peo Sjoblom" wrote in message
...
=SUMPRODUCT(--(A2:A500=DATE(2007,5,1)),--(A2:A500<=DATE(2007,8,31)),B2:B500)


note that I included May 1st and August 31st since that is what I believe
you wanted, if not change the

<=
=


to
<


You can also use

=SUMIF(A2:A500,"="&DATE(2007,5,1),B2:B500)-SUMIF(A2:A500,""&DATE(2007,8,31),B2:B500)

which is probably a bit more efficient if you have a lot of cells to sum


--


Regards,


Peo Sjoblom



"Lee" wrote in message
...
Is there a way to enter a date value that is between 2 dates in
sumproduct or another function that will look at the same column and
return the sum of a different column? If the value is greater than May
1,2007 but less than August 31, 2007 in column A it will return the sum
of the matching rows in column B.
I have tried this with either greater than OR less than and it works but,
when I try them in the same sumproduct() it fails.
Thanks for reading and any information to the right direction.

--
Lee Coleman






  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,268
Default Between using Sumproduct

That's a stupid accounting program. MMDDYYYY is not dates as far as Excel
can tell
You can convert it but not through formatting which just change the display

Best way is probably to select A, then do datatext to columns, click next
twice and in step 3 under column data format select date and MDY from the
dropdown

Also if A2:A500 (replace by your actual range) do NOT have any empty cells
you can use

=SUMPRODUCT(--(--TEXT(A2:A500,"00\/00\/0000")=DATE(2007,5,1)),--(--TEXT(A2:A500,"00\/00\/0000")<=DATE(2007,8,31)),B2:B500)

If there are empty cells you can use


=SUM(IF(A2:A500<"",IF(--TEXT(A2:A500,"00\/00\/0000")=DATE(2007,5,1),IF(--TEXT(A2:A500,"00\/00\/0000")<=DATE(2007,8,31),B2:B500))))


enter with ctrl + shift & enter



--


Regards,


Peo Sjoblom


"Lee" wrote in message
...
I am confused about the Date because the accounting program exports the
invoice date in MMDDYYYY. Will this work with the YYYYMD format that you
have here or do I need to change one of the formats? And it is alot of rows
and I am grateful for Excel 2007 that can handle the 95,000+ rows on one
worksheet.
Thank you for the feedback.
Lee

"Peo Sjoblom" wrote in message
...
=SUMPRODUCT(--(A2:A500=DATE(2007,5,1)),--(A2:A500<=DATE(2007,8,31)),B2:B500)


note that I included May 1st and August 31st since that is what I believe
you wanted, if not change the

<=
=


to
<


You can also use

=SUMIF(A2:A500,"="&DATE(2007,5,1),B2:B500)-SUMIF(A2:A500,""&DATE(2007,8,31),B2:B500)

which is probably a bit more efficient if you have a lot of cells to sum


--


Regards,


Peo Sjoblom



"Lee" wrote in message
...
Is there a way to enter a date value that is between 2 dates in
sumproduct or another function that will look at the same column and
return the sum of a different column? If the value is greater than May
1,2007 but less than August 31, 2007 in column A it will return the sum
of the matching rows in column B.
I have tried this with either greater than OR less than and it works
but, when I try them in the same sumproduct() it fails.
Thanks for reading and any information to the right direction.

--
Lee Coleman








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
sumproduct? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
sumproduct Kim Shelton at PDC Excel Discussion (Misc queries) 0 December 8th 06 09:44 PM
sumproduct RGlade Excel Discussion (Misc queries) 2 December 8th 06 09:41 PM
Sumproduct ... Maybe? Ken Excel Worksheet Functions 5 December 7th 06 10:23 PM
Sumproduct jhicsupt Excel Discussion (Misc queries) 3 December 5th 06 02:04 PM


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