Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Douglas
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function: Ignore Mimimum and Maximum Values Michael J Excel Worksheet Functions 4 March 6th 06 08:41 PM
Auto-prompt/complete (?) function for number values Raj Mazumdar Excel Discussion (Misc queries) 1 January 10th 06 06:49 PM
IF function....testing against values in multiple cells racmb1975 Excel Worksheet Functions 2 October 12th 05 07:50 PM
Function to count unique values? Richard Buttrey Excel Worksheet Functions 5 September 22nd 05 02:58 PM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM


All times are GMT +1. The time now is 02:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"