+ Reply to Thread
Results 1 to 16 of 16

Counting number of unique numbers based on another variable.

  1. #1
    Registered User
    Join Date
    04-24-2014
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    5

    Counting number of unique numbers based on another variable.

    Hi All,

    I have a problem that I've been trying to resolve but just cannot find my answer.

    I run a report that dumps from data from an ERP system. I've attached a sample of this report in excel that has two sheets. A summary and the data.

    I am able to report on the total number of Purchase order lines and total purchase orders using various formulas. I am also able to use formulas to report on the number of lines associated with each product in the I column.

    However I cannot for the life of me work out how to calculate the number of unique Po# (B Column) numbers based on the Product (I Column) and it's driving me insane.

    Would someone be able to assist me?

    Regards
    Attached Files Attached Files

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Counting number of unique numbers based on another variable.

    Hi,

    You can use a PIVOT Table instead, please check the attached file if this is what you were looking for.

    Regards,
    Chandra


    Please click on ‘ * Add Reputation’ button on the left side bottom of my post if I was helpful in resolving the issue.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-24-2014
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting number of unique numbers based on another variable.

    Hi Chandra

    Thanks for your reply. I am looking to avoid using a pivot table for this purpose if possible. Normally I'm a big fan of using them.
    Is what I want to achieve possible using only a formula?

    Regards

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Counting number of unique numbers based on another variable.

    Pl see attached file with formula.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Counting number of unique numbers based on another variable.

    Hi,

    I would first like to apologize to all Moderators and Gurus if I'm breaking any of the forum rules here, but I just got curious and wanted to know more about the following.

    While searching across this forum, I came across the below mentioned thread in which I found a formula similar to this requirement in this thread.

    Apply a formula in a new column that pulls unique values from another column

    I explored the sample workbook posted by the user in the below mentioned thread and just wondered how this unique counting works well through INDEX and MATCH for Country names (Text data) in an array formula whereas in this thread, the same logic does not work out for picking out unique PO# (numeric data).

    The user has used an array formula with a named range CountryList which refers to the list of countries in a column (similar to PO# in this case) and also a data connection Table_css_database_mv_cosl_data_2014DSAProgress[countryName] that fetches the entire data present in the sheet.

    The array formula used is as below and it fetches all the unique country names :

    Please Login or Register  to view this content.
    Could somebody throw light on this?


    Sarang

  6. #6
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Counting number of unique numbers based on another variable.

    Bumping thread due to no response..

  7. #7
    Registered User
    Join Date
    04-24-2014
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting number of unique numbers based on another variable.

    Quote Originally Posted by kvsrinivasamurthy View Post
    Pl see attached file with formula.
    Hi kvsrinivasamurthy,

    Thanks, your solution works well on the sample data. The size of the data is actually different each time, is there anyway to have this work without knowing how many rows there are in the data sheet?

    Best Regards

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Counting number of unique numbers based on another variable.

    Pl see attached file. It takes care of all the rows in the column irrespective of number of Rows.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-24-2014
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting number of unique numbers based on another variable.

    Hi kvsrinivasamurthy,

    Perfect, that works exactly as I am trying to do. Although I don't quite understand what the formula is actually doing. Another quick one if you dont mind. Assuming that the L column has currency values, is it possible to do a sum based on the product just the same way as the frequency? So for example, it would sum up all the EQP CONSUMABLES values and show the $value of them.

    Regards

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Counting number of unique numbers based on another variable.

    Pl see file.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Counting number of unique numbers based on another variable.

    Hi,

    Srinivas solution works perfectly..

    One small correction though which I noted for calculating currency values (from col L) is

    Instead of using static formula :
    Please Login or Register  to view this content.
    We can use (similar to counting unique PO# and using array formulas [confirmed] by pressing CTRL + SHIFT + ENTER ) :
    Please Login or Register  to view this content.

    Sarang

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Counting number of unique numbers based on another variable.

    Thanks Saarang84. Sorry for the mistake I did.

  13. #13
    Registered User
    Join Date
    04-24-2014
    Location
    Perth
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting number of unique numbers based on another variable.

    Thanks very much for your help kvsrinivasamurthy and saarang84. All problems solved and I have my report doing exactly what I want.

    Regards

  14. #14
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Counting number of unique numbers based on another variable.

    If you find your requirement solved, then you can mark it as Solved against the thread name by choosing from the Thread tools menu which is found between your thread name and the first post you made.

    Also, you can add to the reputation of the experts who have helped you with a solution to your requirement as you may like.
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  15. #15
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Counting number of unique numbers based on another variable.

    @uradox: see attached file with much simpler and efficient formulae owing to the use of Smart Table (select a cell within the table, hit CTRL+T, click OK; alternately ALT > N > T).

    @saarang84: regarding your post #5, no reason it should not work if setup correctly and array-entered. give a dekko...
    Attached Files Attached Files
    Last edited by icestationzbra; 05-02-2014 at 09:20 AM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  16. #16
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Counting number of unique numbers based on another variable.

    Hi Ice,

    How is the table created from the source data?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Counting Number of Unique Values in a List based on Criteria
    By greencroft in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-03-2014, 04:00 AM
  2. Replies: 5
    Last Post: 07-22-2013, 05:56 PM
  3. [SOLVED] Counting a column of numbers based on a unique identifier
    By aaanenson in forum Excel General
    Replies: 2
    Last Post: 08-23-2012, 09:01 PM
  4. counting unique values in a variable length column
    By saimike in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-16-2012, 10:58 AM
  5. Counting Unique Numbers based on Date
    By hanjimono in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-23-2010, 05:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1