> Works fine Don,
> in my case our subject (number of days) is just a part of a bigger
> formula, how to overcome using an arry formula.
Give this non-array formula a try...
=SUMPRODUCT(MAX((B2:B10=C2)*(A2:A10)))+SUMPRODUCT(MAX((B2:B10=C2)*(99999-A2:A10)))-99999
where I assumed the dates started in A2, the code items in B2 and the
specified code item you wanted to calculate the date difference for in C2.
Rick
excelFan - 26 Aug 2007 10:46 GMT
> > Works fine Don,
> > in my case our subject (number of days) is just a part of a bigger
> > formula, how to overcome using an arry formula.
Thanks Rick,
just perfect that's does it, many thanks again
> Give this non-array formula a try...
>
[quoted text clipped - 4 lines]
>
> Rick
Try this. Kind of tricky in that the max and min are DIFFERENT.
=SUMPRODUCT(MAX((B6:B14="azm")*(A6:A14)))-SUMPRODUCT(MIN(B6:B14="azm",A6:A14))

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
> Works fine Don,
> in my case our subject (number of days) is just a part of a bigger
[quoted text clipped - 25 lines]
>> > item
>> > in column B
Rick Rothstein (MVP - VB) - 26 Aug 2007 15:01 GMT
I do not get the 'min' part of your formula to produce the correct result.
Yes, for the data given and for item "azm" it works, but that appears to be
because of the particular layout of the data. Try changing "azm" to "naf" to
see the problem.
Rick
> Try this. Kind of tricky in that the max and min are DIFFERENT.
> =SUMPRODUCT(MAX((B6:B14="azm")*(A6:A14)))-SUMPRODUCT(MIN(B6:B14="azm",A6:A14))
[quoted text clipped - 29 lines]
>>> > item
>>> > in column B
Don Guillett - 26 Aug 2007 15:14 GMT
Actually, I wondered why it would work. Sometimes I forget to FULLY test.

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
>I do not get the 'min' part of your formula to produce the correct result.
>Yes, for the data given and for item "azm" it works, but that appears to be
[quoted text clipped - 36 lines]
>>>> > item
>>>> > in column B
excelFan - 26 Aug 2007 18:38 GMT
many thanks Don,
this formula does not yield an ok numbers for the given data , may be
because of the min part of it , so please fully test and revert.
> Try this. Kind of tricky in that the max and min are DIFFERENT.
> =SUMPRODUCT(MAX((B6:B14="azm")*(A6:A14)))-SUMPRODUCT(MIN(B6:B14="azm",A6:A14))
[quoted text clipped - 28 lines]
> >> > item
> >> > in column B
Max - 27 Aug 2007 17:40 GMT
Just wondering aloud why array-entering your combined formula (ie after
combining the original array suggested into your other, presumably non-array
formula) didn't work for you.

Signature
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
excelFan - 28 Aug 2007 13:32 GMT
galdly yes, there is a non array formula solved my issue, please refer to
Rick Rothstien's suggested non array formula above, it's just great
excelFan
> Just wondering aloud why array-entering your combined formula (ie after
> combining the original array suggested into your other, presumably non-array
> formula) didn't work for you.