H
Harry Flashman
In column A i have range of cells with dates. For example $A$2:$A$1000
that I have named "SalesDate"
In Column B I have range of cells with a dollar values. For example $B
$1000 that I have named "SalesValue"
On another worksheet I have successfully summed the monthly sales
figures using the following formula:
=SUMPRODUCT((MONTH(SalesDate)=MONTH(A2))*(SalesValue))
In the above example B2 = Jan-01
This variation also worked:
=SUMPRODUCT(((DATE(YEAR(SalesDate),MONTH(SalesDate),
1)=A2))*(SalesValue))
Now I would like to sum the weekly sales. I tried to use this formula
but without succcess:
=SUMPRODUCT((WEEKNUM(SalesDate)=WEEKNUM(A2))*(SalesValue))
This returns #VALUE!
I have search the internet for a solution but without success. I
gather that WEEKNUM does not work with arrays.
I solved my problem a helper column next to my date range which uses
WEEKNUM and then I have referenced the WEEKNUM range with the SUMIF
function. This works, so in a sense I have solved my problem.
But I am curious. Can this be solved without a helper column?
One of the reasons I ask is that I am trying to help my girlfriend out
and her company uses a spreadsheet which is formatted a particular way
and she would prefer it if I did not alter it by adding another column
(silly I know).
However it would surprise me if there wasn't some easy way of doing
this. One post I read suggested using UDF version of WEEKNUM that does
allow arrays, but I couldn't get it to work.
Any ideas? or is what I am asking not practical?
that I have named "SalesDate"
In Column B I have range of cells with a dollar values. For example $B
$1000 that I have named "SalesValue"
On another worksheet I have successfully summed the monthly sales
figures using the following formula:
=SUMPRODUCT((MONTH(SalesDate)=MONTH(A2))*(SalesValue))
In the above example B2 = Jan-01
This variation also worked:
=SUMPRODUCT(((DATE(YEAR(SalesDate),MONTH(SalesDate),
1)=A2))*(SalesValue))
Now I would like to sum the weekly sales. I tried to use this formula
but without succcess:
=SUMPRODUCT((WEEKNUM(SalesDate)=WEEKNUM(A2))*(SalesValue))
This returns #VALUE!
I have search the internet for a solution but without success. I
gather that WEEKNUM does not work with arrays.
I solved my problem a helper column next to my date range which uses
WEEKNUM and then I have referenced the WEEKNUM range with the SUMIF
function. This works, so in a sense I have solved my problem.
But I am curious. Can this be solved without a helper column?
One of the reasons I ask is that I am trying to help my girlfriend out
and her company uses a spreadsheet which is formatted a particular way
and she would prefer it if I did not alter it by adding another column
(silly I know).
However it would surprise me if there wasn't some easy way of doing
this. One post I read suggested using UDF version of WEEKNUM that does
allow arrays, but I couldn't get it to work.
Any ideas? or is what I am asking not practical?