Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Function to add different values
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? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Function to add different values
One way
=SUMPRODUCT(--(A1:A10<""),--(1/COUNTIF(A1:A10,A1:A10&"")),A1:A10) with your data in A1:A10 -- Regards, Peo Sjoblom http://nwexcelsolutions.com "Douglas" wrote in message ... 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? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Function to add different values
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) < 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 "Douglas" wrote in message ... 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Function: Ignore Mimimum and Maximum Values | Excel Worksheet Functions | |||
Auto-prompt/complete (?) function for number values | Excel Discussion (Misc queries) | |||
IF function....testing against values in multiple cells | Excel Worksheet Functions | |||
Function to count unique values? | Excel Worksheet Functions | |||
Error Handling #N/A with AVERAGE Function - Average of values in Row | Excel Worksheet Functions |