Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default sumproduct

Try this in a new worksheet
Put a bunch of stuff in A1:A10 (duplicates ok--no empty cells)
Put this in B1:
=1/COUNTIF($A$1:$A$10,A1)
And drag down through b10
Now sum B1:B10

If a value occurs twice in the list, you'll see .5
If it occurs 3 times, you'll see .333333
If it only occurs once, you'll see 1.

This formula:
=SUMPRODUCT((A1:A10<"")/COUNTIF(A1:A10,A1:A10&""))
essentially does this exact thing, but in one cell.

It also will fix any problems caused by empty cells. If you go back to your
test data and clear contents of one of the cells in A1:A10, you'll see #div/0
errors. (That's what the &"" will fix.)



Nad wrote:

Ok Dave
Its fine. I got the result but i could not understand the statement
(=SUMPRODUCT((A1:A10<"")/COUNTIF(A1:A10,A1:A10&"")).
will you please explain the statement.
if any other method to find.
Thanks & Regards
Nad

"Dave Peterson" wrote:

one way:

=SUMPRODUCT((A1:A10<"")/COUNTIF(A1:A10,A1:A10&""))

(adjust the range to match, but don't use the whole column)

Nad wrote:

thanks toppers
You are really topper.
i have another question
i want to count number of unique cars in range say A1:A10.
regards

"Toppers" wrote:

=sumproduct(--(a1:a10="Ford"),--(b1:b10="A")) +
sumproduct(--(a1:a10="Toyota"),--(b1:b10="A")) '=== Count

=sumproduct(--(a1:a10="Ford"),--(b1:b10="A"),(c1:c10)) +
sumproduct(--(a1:a10="Toyota"),--(b1:b10="A"),(c1:c10)) '=== sell


"Nad" wrote:

Hi every body
I have this
Car CATEGORY SELL
Ford A 5
BMW A 3
Ford B 8
Toyota A 1
Ford C 4
Ford A 7
BMW A 6
Ford A 7
Toyota B 5
Ford A 9
I have two questions
1) I want to count the Ford and Toyota whose category is 'A'.
2) Also i want to sum the total sell of Ford and Toyota with category 'A'.
Please solve this .
Thanks & regards
Nad


--

Dave Peterson


--

Dave Peterson
 
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
Adding "OR" to a Sumproduct Formula Duke Carey Excel Worksheet Functions 0 March 21st 06 06:41 PM
Need help with sumproduct & dynamic ranges bill_s1416 Excel Worksheet Functions 1 March 19th 06 03:36 AM
Sumproduct Peter B Excel Worksheet Functions 1 March 7th 05 01:59 PM
Sumproduct function not working Scott Summerlin Excel Worksheet Functions 12 December 4th 04 05:15 AM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM


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

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

About Us

"It's about Microsoft Excel"