make a list from a table
"MB" skrev i en meddelelse
...
Is it possible to make a list that takes the values from a list if the
value
is over 0? I have a table with dates and every day you can list 14
different
moments. Now I want to list those days and moments where the value is over
0.
The table
Date 1.1 2.1 3.1 .
Moment1 10 0 0
Moment2 0 8 8
Moment3 0 0 0
Moment4 8 0 10
.
The new list
1.1 Moment1 10
1.1 Moment4 8
2.1 Moment2 8
3.1 Moment2 8
3.1 Moment4 10
.
MB
Here's one way to do it:
All formulae entered as one line.
I have put your table in A1:D5. Adjust all cell references
to mirror your setup.
In e.g. L2 this formula:
=OFFSET($B$1,, COLUMNS($B$1:$D$1)-SUMPRODUCT(((ROW()-ROW($L$2)+1)<=
COUNTIF(OFFSET($B$2:$B$5,,,,ROW(INDIRECT("1:"&COLU MNS($B$1:$D$1)))),"<"&0))+0))
In M2 this array formula:
=INDEX($A$2:$A$5, SMALL(IF(OFFSET($B$2:$B$5,,MATCH(L2,$B$1:$D$1,0)-1)<0,
ROW($B$2:$B$5)-ROW($B$2)+1),COUNTIF($L$2:L2,L2)))
To be entered with <Shift<Ctrl<Enter, also if edited later.
In N2 this formula:
=INDEX($B$2:$D$5,MATCH(M2,$A$2:$A$5,0),MATCH(L2,$B $1:$D$1,0))
If you start in a cell different from L2, replace $L$2 and L2 by the
new startcell's reference.
Select L2:N2 and copy down with the fill handle (the little square in the
lower right corner of the cell)
Format column L as date.
--
Best regards
Leo Heuser
Followup to newsgroup only please.
|