close

I need one function that adds values that are not equal.

Like this:
3
3
3
4
4
5
5

I need a formula that will go to add value 3 4 5.
Only different numbers between itself.
Which are my options?

One way

=SUMPRODUCT(--(A1:A10lt;gt;quot;quot;),--(1/COUNTIF(A1:A10,A1:A10amp;quot;quot;)),A1:A10)

with your data in A1:A10--

Regards,

Peo Sjoblom

nwexcelsolutions.comquot;Douglasquot; gt; wrote in message
...
gt;I need one function that adds values that are not equal.
gt;
gt; Like this:
gt; 3
gt; 3
gt; 3
gt; 4
gt; 4
gt; 5
gt; 5
gt;
gt; I need a formula that will go to add value 3 4 5.
gt; Only different numbers between itself.
gt; Which are my options?
Two possible ways - both assume cells are sorted.

Simple method with helper column
Assume cells are A1:A7
In B1 enter = A1
In B2 enter =IF(A2=A1,0,A2)
Copy down to B7
Find SUM(B1:B7)

User-defined function:
Function unique(myrange)
Dim mycount As Integer
Dim j As Integer
mycount = myrange.Count
unique = myrange(1)
For j = 2 To mycount
If myrange(j) lt;gt; myrange(j - 1) Then
unique = unique myrange(j)
End If
Next j
End Function

Use with =UNIQUE(A1:A7)

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

quot;Douglasquot; gt; wrote in message
...
gt;I need one function that adds values that are not equal.
gt;
gt; Like this:
gt; 3
gt; 3
gt; 3
gt; 4
gt; 4
gt; 5
gt; 5
gt;
gt; I need a formula that will go to add value 3 4 5.
gt; Only different numbers between itself.
gt; Which are my options?

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()