+ Reply to Thread
Results 1 to 17 of 17

Counting unique entries with if condition

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Counting unique entries with if condition

    Sample.JPG
    Column A has duplicate values and Column F has a date in it.
    I need to count total number of unique values from Column A which also meets the second condition of having some data in column F.
    The formula should count total numbers of unique entries from Column A which has a date mentioned in column F, if the column F is blank then it should not count that entry.
    Let me know if I need to ask more precisly, I can upload a screenshot. I am working on excel 2003.
    I believe it should be some kind of a combination of sumproduct and if.
    But I am not smart enought to figure this out. Please provide formula, thanks
    Attached Files Attached Files
    Last edited by Jigz; 06-07-2012 at 02:53 PM. Reason: Screenshot added

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Counting unique entries with if condition

    Hi Jigz,

    I believe you can use a pivot table to get your desired results.. upload a sample workbook so that I can give a quick try... thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    I've added a screet shot, I need the forumula for C28

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Counting unique entries with if condition

    Hi Jigz,

    Suggest you to upload a excel workbook and I can't show you a pivot from a picture ...
    If you want to give a quick try.. draw a pivot and have first column in row and second column count in data.. now where you have the data .. you'll get the answer
    Now uncheck the data fields with blank entries .. I can think of this.. but would be confident if you upload a excel workbook. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    Excel file attached

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Counting unique entries with if condition

    Hi Jigz,

    See the attached file and check the pivot and the green cells with answers.. thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    Sorry, but I don't see the attached file.

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Counting unique entries with if condition

    Oopss... attached below:-

    Jigz -Sample(14).xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  9. #9
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    But I would still appreciate if this can be solved using formula. Because my original file has over 6000 rows and I am not confident on using this Pivot table...
    I am preety sure there must be some kind of a combination of sumproduct, if and countif forumulas..
    Thanks a lot for your help though..

  10. #10
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Counting unique entries with if condition

    Everything is already done there... you just need to refresh pivot (even which is now "Refresh on Open") and you are good to go... try adding more data and you'll find that this is working fine..

    Regards,
    DILIPandey


    <click on below 'star' if this helps>

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Counting unique entries with if condition

    just to reinforce dilipandey's comments, a pivot table is much easier to work with, and, if set up properly, will give you the answers you need
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  12. #12
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    I completely agree, but still, if someone can provide a formula, it will be highly appreciated.

  13. #13
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    If somebody can provide a formula, I would higly appreciate it.
    Thanks

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Counting unique entries with if condition

    in cell B5, copied down, try this...

    =IF(F5="","",IF(ISERROR(VLOOKUP(A5,A6:$A$22,1,FALSE)),1+COUNT($B$4:B4),""))

    let me know how that works for you?

  15. #15
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    Hi FDibbins, thannks for your efforts. I think we need little bit of fine tuning here... You are closed to solving this.
    The result comes 1 less than the correct answer. It comes to 6 instead of 7.
    Another problem with the above provided formula is when I enter a date in F10, column B is not adding 1 more count but when I add a date F11 it adds 1 more count. A10 and A11 are duplicate values and therefore, it should add 1 count when I put dates in either F10 or F11.
    Thanks again

  16. #16
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    Any help yet ??

  17. #17
    Registered User
    Join Date
    05-17-2012
    Location
    Sadlenebtitri
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Counting unique entries with if condition

    I am using following formula... but getting wrong answer..
    Can I have some suggestion to make it work ?
    =SUMPRODUCT((SUM(IF(FREQUENCY(MATCH(A16:A5750,A16:A5750,0),MATCH(A16:A5750,A16:A5750,0))>0,1)))*(AU16:AU5750<>""))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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