Count Formula

chrysti

Board Regular
Joined
Dec 20, 2006
Messages
218
I am using a sumproduct (without the range to sum) to count a list of information that I have, but the issue that I am having is that because this list has everything that we carry and who we have sold it to, things appear in the list more than once. I only want to know how many different items we sold, not how many times we sold that item...is there anyway to get the formula to count only the first time that it encounters a style on the list? They all have different names so it is hard to say only count this, because I am wanting to do it for hundreds of different styles and thousands of sales.

Thanks in advace for the help
Chrysti
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
hi Chrysti

You didn't indicate how your data is structured, but here is one way - it counts the number of unique courses in the B column:
Excel Workbook
ABCDE
1EmployeeCourse TakenDate
2RichardBaking01-Jan
3BobArchery16-Jan
4SallyArchery31-Jan
5SarahBaking15-Feb
6ChrisFootball02-Mar
7MarkBaking17-MarUnique courses
8TimRugby01-Apr5
9TedBaking16-Apr
10HelenYoga01-May
11RondaArchery16-May
Sheet1
Excel 2002
Cell Formulas
RangeFormula
E8=SUMPRODUCT((B2:B11<>"")/COUNTIF(B2:B11,B2:B11&""))
 
Upvote 0
This is exactly what I need except there would be a tweak, I need to do it by customer type so I would need to add something to filter column a as well, like all the classes that Sarah and Mike are taking that are new...can this be done???

Thanks so much for the quick reply
Chrysti
 
Upvote 0
By "new classes" do you mean the most recent date?
 
Upvote 0
Lets say I want to know how many unique classes the girls are taking and how many unique classes the boys are taking based on the names in column A I would classify in a seperate column for ease boy/girl and then count.

Can this be done???

Thanks so much!!!
 
Upvote 0
If it is unique count for just Sarah and Richard, then do you want to ask the logical question "if there is at least one "Sarah" in the column, then give me a count of 1?", and the same question for Richard? If so this might work:
Excel Workbook
ABCDE
1EmployeeCourse TakenDate
2RichardBaking1-Jan
3BobArchery16-Jan
4SallyArchery31-Jan
5SarahBaking15-Feb
6ChrisFootball2-Mar
7RichardBaking17-MarUnique courses
8BobRugby1-Apr2
9SallyBaking16-Apr
10SarahYoga1-May
11SarahArchery16-May
Sheet1
Excel 2010
Cell Formulas
RangeFormula
E8=SUMPRODUCT((A2:A11<>"")*((A2:A11="Sarah")+(A2:A11="Richard"))/COUNTIF(A2:A11,A2:A11&""))
 
Upvote 0
Or if the goal is to just see if Sarah Or Richard are listed just once, then maybe this would work:

=(COUNTIF(A2:A11,"Sarah")>0)+(COUNTIF(A2:A11,"Richard")>0)
 
Upvote 0
Chrysti

It would almost certainly help us to understand what you want to achieve if you could upload a sample of your data (remove any and all confidential information beforehand or use dummy data) and indicate the results you want to achieve from this sample and how you determine those results.

One of the easiest ways of doing this is simply to select your data in Excel (eg select A1:G40) and do an Edit>Copy and then go into your reply in your browser and do a ctrl+v to paste it in. other alternatives would include using the html maker add in which both Mike and I used in some of our replies above to do the same - if you want to go this route, please could you drop me a PM with your email address and I will send it to you :)
 
Upvote 0
Try this for the "Unique Count of Classes for Boys" and "Unique Count of Classes for Girls":
Excel Workbook
ABCDEF
1EmployeeCourse TakenDateBoy?Girl
2RichardBaking1-JanBoy
3BobArchery16-JanBoy
4SallyArchery31-JanGirl
5SarahBaking15-FebGirlUnique courses For Girls
6ChrisFootball2-MarBoy3
7RichardBaking17-MarBoyUnique courses For Boys
8BobRugby1-AprBoy4
9SallyBaking16-AprGirl
10SarahYoga1-MayGirl
11SarahArchery16-MayGirl
Sheet1
Excel 2010
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
 
Upvote 0

Forum statistics

Threads
1,212,056
Messages
6,105,648
Members
447,974
Latest member
misspancake

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top