?
Solved

Count Unique Numbers (no blanks) + Only Counting Those Numbers That Start with 3

Posted on 2014-02-05
3
Medium Priority
?
255 Views
Last Modified: 2014-02-05
So I have a couple of columns where I am trying to get the Unique count of the order number.  Depending on where they purchased the item(s) the first digit of the order number is different.  So I did a formula to get the overall count of the distinct order numbers

=SUM(IF(FREQUENCY(MATCH(Sales_Invoice_Line[Sales Invoice Header - Order Number],Sales_Invoice_Line[Sales Invoice Header - Order Number],0),MATCH(Sales_Invoice_Line[Sales Invoice Header - Order Number],Sales_Invoice_Line[Sales Invoice Header - Order Number],0))>0,1))

Open in new window


Now I wanted to break down Number of Orders per location, which if the Order number starts with 3 then its one location if it starts with 4 its another location, etc.  I did SUMPRODUCT for the total $$ and that formula looks like

=SUMPRODUCT(--(LEFT(Sales_Invoice_Line[Sales Invoice Header - Order Number],1)="3"),--(Sales_Invoice_Line[Type]="Item"),Sales_Invoice_Line[Amount])

Open in new window


But not sure how to combine the 2 to count uniques -- my attempt

=SUM(IF(FREQUENCY(MATCH((LEFT(Sales_Invoice_Line[Sales Invoice Header - Order Number],1)="3"),(LEFT(Sales_Invoice_Line[Sales Invoice Header - Order Number],1)="3"),0),MATCH((LEFT(Sales_Invoice_Line[Sales Invoice Header - Order Number],1)="3"),(LEFT(Sales_Invoice_Line[Sales Invoice Header - Order Number],1)="3"),0))>0,1))

Open in new window


I know, I know .. crappy

Any thoughts?
0
Comment
Question by:iceman19330
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 31

Expert Comment

by:gowflow
ID: 39836315
to find ourselves with these name ranges could you post a workbook that contains this info ?
gowflow
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 total points
ID: 39836455
To count the number of different order numbers beginning with 3 try this formula

=SUMPRODUCT((LEFT(Sales_Invoice_Line[Sales Invoice Header - Order Number],1)="3")/COUNTIF(Sales_Invoice_Line[Sales Invoice Header - Order Number],Sales_Invoice_Line[Sales Invoice Header - Order Number]&""))

see attached where I used the above formula but with a simple range A2:A10

regards, barry
uniques.xlsx
0
 

Author Closing Comment

by:iceman19330
ID: 39836559
It works!  Sweet!  Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question