.. It works ALMOST perfectly. ..
Yes, as per the caveat mentioned in my earlier response <g,
... (above assumes the +/- number cancellations
within the column are exactly in pairs)
Think this revised set-up should deliver what we're after ..
Assume data is in Sheet1's col A, A1 down:
123
-123
-123
124
-124
124
etc
Put in B1:
=IF(A1="","",COUNTIF($A$1:A1,A1))
Put in C1, and array-enter the formula,
i.e. press CTRL+SHIFT+ENTER
(instead of just pressing ENTER):
=IF(B1="","",IF(ISNUMBER(MATCH(-A1&"_"&B1,$A$1:$A$100&"_"&$B$1:$B$100,0)),""
,ROW()))
Select B1:C1, fill down to say, C100,
to cover the max expected data in col A
Note: Adapt the ranges $A$1:$A$100, $B$1:$B$100 in the formula in C1 to
suit. We can't use entire col references (e.g.: A:A, B:B) in the array
formula for col C.
In a new Sheet2
--------------
Put in A1:
=IF(ISERROR(SMALL(Sheet1!C:C,ROWS($A$1:A1))),"",IN DEX(Sheet1!A:A,MATCH(SMALL
(Sheet1!C:C,ROWS($A$1:A1)),Sheet1!C:C,0)))
(Normal ENTER will do)
Note that the entire formula above should be in one line. You would need to
rectify the inevitable line breaks / wraps [especially for long formulas]
after you directly copy paste the formula from the post into the cell /
formula bar.
Copy A1 down to A100
(cover the same range as done in Sheet1's cols B & C)
Sheet will return the desired results neatly bunched at the top,
viz. for the sample data above, you'd get:
-123
124
(blank rows below)
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"chom krusopon" wrote in message
...
Max, First thanks so much for your reply. It works ALMOST perfectly. The
only
problem I still have is when I have more than one set of numbers that
cancel
each other out, the formula doesn't capture it. Ex:
123
-123
-123
Your formula will capture the 123 in row 1 and row 2 as being cancelled
one
another, but doesn't recognize that the 3rd row should be unique and has
nothing to do with the first two rows. Can you help me a little further,
pleaset? Thank You, Chom
|