View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Leo Heuser[_2_] Leo Heuser[_2_] is offline
external usenet poster
 
Posts: 111
Default What is the problem in this formula

Or, with one function call less
(still array-entered) :

=SUM(OFFSET($B$1,,,MIN(ROW()-ROW($C$1))+1)*
MMULT(N((MIN(ROW(OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))+
MAX(ROW(OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))-
ROW(OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))=
TRANSPOSE(ROW(OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))),
OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))

LeoH


"Leo Heuser" skrev i en meddelelse
...
Hallo Gerhard

For a non-macro solution try this array formula
entered in C1. Not a beauty, but it will do the job :-)

=MMULT(TRANSPOSE(OFFSET($B$1,,,MIN(ROW()-ROW($C$1))+1)),
MMULT(N((MIN(ROW(OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))+
MAX(ROW(OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))-
ROW(OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))=
TRANSPOSE(ROW(OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))),
OFFSET($A$1,,,MIN(ROW()-ROW($C$1))+1)))

The formula must be array-entered, i.e. with <Shift<Ctrl<Enter
instead of <Enter, also if edited later. If done properly, Excel will
display the formula in the formula bar enclosed in curly brackets { }
Don't enter these brackets yourself.
Copy C1 down with the fill handle (the little square in the lower right
corner of the cell)

--
Best Regards
Leo Heuser

Followup to newsgroup only please.