+ Reply to Thread
Results 1 to 12 of 12

Need help - Count unique value that matches given condition

  1. #1
    Registered User
    Join Date
    07-08-2014
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    6

    Need help - Count unique value that matches given condition

    Hi all,

    I am having a dead end in writing a formula that will return the number of unique value that matches certain condition. My table is as below

    Capture.PNG

    My consolidation table is like this

    Capture.PNG

    In b3, I need to count the how many teachers appeared in table 1. It should be 4:

    How should I write the formula to calculate it? I am using Excel 2013

    Thanks in advance guys.
    ,
    Last edited by Mintha; 06-02-2016 at 05:23 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need help - Count unique value that matches given condition

    use Pivot table to achieve this.

  3. #3
    Registered User
    Join Date
    07-08-2014
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    6

    Re: Need help - Count unique value that matches given condition

    Is there a way to calculate using formula? we would like to automate the report so that when raw data are pasted in the first table, the number will just come out rather than having a person using pivot table to find out the number and type it in the second table.

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Need help - Count unique value that matches given condition

    What are names of both sheets
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Registered User
    Join Date
    07-08-2014
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    6

    Re: Need help - Count unique value that matches given condition

    Table 1 is from a sheet called Oct15
    Table 2 is from a sheet called Consolidation

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need help - Count unique value that matches given condition

    Here, try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Confirmed with ctrl+shift+enter (not just enter) where A3 is criteria in current sheet.

  7. #7
    Registered User
    Join Date
    07-08-2014
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    6

    Re: Need help - Count unique value that matches given condition

    Hi zbor,

    I tried to replace with the correct address but it returns the value = 0..., even when I hit ctrl shift enter

    I think I replace it wrong...

    I've attached the original file, please could you take a quick look to see how I should replace it.

    The consolidation table is from A53:N58 in sheet consolidation.
    The data for B55 in sheet consolidation will be taken from sheet Oct15.

    Here is the original file
    https://www.mediafire.com/?eb0tvnccqgw12ey

    I apologize for being such a bother.

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need help - Count unique value that matches given condition

    With this formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    this is a result I've got:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-08-2014
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    6

    Re: Need help - Count unique value that matches given condition

    Wow zbor, I got it. You're my hero.

    What's the difference between enter and ctrl shift enter? Why does pressing them giving different results in this case?

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need help - Count unique value that matches given condition

    It's called array formula.
    An array formula is a formula that works with an array, or series, of data values rather than a single data value.

    To enter a formula as an array formula, type the formula in the cell and press the CTRL SHIFT and ENTER keys at the same time rather then just ENTER.
    You must do this the first time you enter the formula and whenever you edit the formula later.
    If you do this properly, Excel will display the formula enclosed in curly braces { }. You do not type in the braces -- Excel will display them automatically.
    If you neglect to enter the formula with CTRL SHIFT ENTER, the formula may return a #VALUE error or return an incorrect result.

  11. #11
    Registered User
    Join Date
    07-08-2014
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    6

    Re: Need help - Count unique value that matches given condition

    I have another question, not related to unique value though.

    If I have a table like this

    Capture.PNG

    If I need to count how many lines in column G that contain the word "ipad" or "tablet" or "android" (if it contains two words as in line 2, count as 1) what should I put for formula?

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need help - Count unique value that matches given condition

    Please open new thread for new question.
    You will also get answer sooner.

+ 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] Need to count the number of unique values after 1st part of cell matches
    By PeteABC123 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-11-2014, 03:26 PM
  2. Count Unique in one colum based on matches in other Column
    By ExcellentM in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2012, 03:22 PM
  3. Count Condition Unique Items
    By Gos-C in forum Excel General
    Replies: 15
    Last Post: 01-23-2009, 10:14 PM
  4. Count unique numbers with an AND condition????
    By ajajmannen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-05-2007, 09:15 AM
  5. trying to count unique occurences w/in data that matches multiple criteria
    By broro183 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2006, 08:11 AM
  6. [SOLVED] how do I count pairs of cells when each matches a condition?
    By Richard pile in forum Excel General
    Replies: 4
    Last Post: 02-20-2006, 04:00 PM
  7. How do you count data that matches more than one condition?
    By ryesworld in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-08-2005, 09:00 PM

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