ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   nesting "and" in sumproduct function (https://www.excelbanter.com/excel-discussion-misc-queries/125016-nesting-sumproduct-function.html)

George P

nesting "and" in sumproduct function
 
I need to nest a date range argument in a sumproduct function but can't seem
to get it to work. When I only write "...<=c1)" within the string, it works
for any data less than or equal to the cell's date, but I need to say
"...=x-date AND <=y-date...".

I'm sure its staring me in the face but...

Thanks for your help out there.

George

bpeltzer

nesting "and" in sumproduct function
 
To get expression1 AND expression2 in Excel, you'd use
=AND(expression1,expression2).
If you're doing this within a sumproduct, however, you could just treat each
as a separate condition...
=sumproduct(--(date_range=c1),--(date_range<=d1),value_range) will add all
the values corresponding to dates in the range [c1,d1].


"George P" wrote:

I need to nest a date range argument in a sumproduct function but can't seem
to get it to work. When I only write "...<=c1)" within the string, it works
for any data less than or equal to the cell's date, but I need to say
"...=x-date AND <=y-date...".

I'm sure its staring me in the face but...

Thanks for your help out there.

George



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com