H
Harry Flashman
I am finding this a little unpredictable. Sometimes it works fine; for
example:
A B C D
Date Mar-08 Feb-08 Jan-08
If I wish to return the column number from the dates:
Mar-08 =MATCH(A2,$A$1:$D$1) returns the value 2
Feb-08 =MATCH(A3,$A$1:$D$1) returns the value 3
Jan-08 =MATCH(A4,$A$1:$D$1) returns the value 4
However if I expand the reference to include column E, Dec-07 I get
this result:
Mar-08 =MATCH(A2,$A$1:$E$1) returns the value 5 (which is the total
number of cells in the reference).
Can anyone explain why this would be the case?
(The dates are actually 01/03/2008 (UK style) but I have used custom
format to display them as mmm-yy. Also the dates are always the first
of the month.)
Then next part of my question is a little more complex.
In column A I have a product names
In column B I have the first date that this product was sold.
In Column D to A I have the product sales by month.
I would like to use the AVERAGE formula in in column C to calculate
the average sales over time.
However not all products have the same history; some are more recent
than others; products have the value zero in the months before they
appeared.
Therefore if a product has been around since the start the formula
will be =AVERAGE(D2:Z2)
But if the product has only been around for the past three months the
formula will be =AVERAGE(D2:F2)
I would like to use the MATCH formula (or a similar formula) to
replace the second cell reference in my AVERAGE formula. That is, a
nested formula that references the values in column B (the date the
product was first sold) and returns the appropriate column reference.
I hope I have been clear. Can anyone help with either of these
question? I would be eternally grateful.
Harry
example:
A B C D
Date Mar-08 Feb-08 Jan-08
If I wish to return the column number from the dates:
Mar-08 =MATCH(A2,$A$1:$D$1) returns the value 2
Feb-08 =MATCH(A3,$A$1:$D$1) returns the value 3
Jan-08 =MATCH(A4,$A$1:$D$1) returns the value 4
However if I expand the reference to include column E, Dec-07 I get
this result:
Mar-08 =MATCH(A2,$A$1:$E$1) returns the value 5 (which is the total
number of cells in the reference).
Can anyone explain why this would be the case?
(The dates are actually 01/03/2008 (UK style) but I have used custom
format to display them as mmm-yy. Also the dates are always the first
of the month.)
Then next part of my question is a little more complex.
In column A I have a product names
In column B I have the first date that this product was sold.
In Column D to A I have the product sales by month.
I would like to use the AVERAGE formula in in column C to calculate
the average sales over time.
However not all products have the same history; some are more recent
than others; products have the value zero in the months before they
appeared.
Therefore if a product has been around since the start the formula
will be =AVERAGE(D2:Z2)
But if the product has only been around for the past three months the
formula will be =AVERAGE(D2:F2)
I would like to use the MATCH formula (or a similar formula) to
replace the second cell reference in my AVERAGE formula. That is, a
nested formula that references the values in column B (the date the
product was first sold) and returns the appropriate column reference.
I hope I have been clear. Can anyone help with either of these
question? I would be eternally grateful.
Harry