Page 1 of 5 123 ... LastLast
Results 1 to 10 of 46

Thread: Formulas to count including Unique Numbers

  1. #1
    Board Regular
    Join Date
    Feb 2018
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Formulas to count including Unique Numbers

    Hi,

    I've tried this before but ended up going around in circles because i was not asking the right questions. Hopefully the below will clear all this up.

    User ID Name Last Logon UTC Model Type
    1 Gary 01/01/2019 No AD COL
    1 Stephen 02/01/2019 No REL COL
    1 Brian No REL COL
    2 Graham 05/03/2019 Yes REL SIM
    3 Steve No REL COL
    4 Clare 06/05/2019 Yes REL SIM
    4 Trev Yes AD COL
    5 Simon 03/03/2018 No REL COL
    6 Rich No AD SIM
    7 Darren 05/06/2019 No REL COL
    8 John 01/04/2018 No AD SIM
    8 Andrew No REL SIM
    9 Oliver Yes REL SIM

    So work on the assumption that the User ID's is Column A and so on. So the formulas I need will be going into Column G and beyond.

    1st query. How many unique User ID’s are there with the following criteria – There is text in the Last Logon field and also the UTC is=”No”. So in this example the answer would be 3. This is User ID 1,5 & 8.
    2nd query. As above but I now need to see how many unique User ID’s there are with the following criteria – The Last Logon field is blank and the UTC is =”No”. The important part with this one is that all of the same User ID’s must meet this requirement. So for instance User ID 1, Brian has not logged on and his UTC is “No”. But Gary and Stephen have logged on so this User id is not to be counted. So using this method the answer would be 2. This would be Rich and Steve.
    3rd query. I need to count the total amount of User ID’s where at least 1 person has data in the Last logged on field and the UTC = “No”. This is not unique and I need a total. In this case it would be 5 (Gary, Stephen, John, Darren, Simon)
    4th query. I need to count the total amount of User ID’s where at least 1 person has data in their Last Logon box and the UTC =”No”. This count needs to be User ID’s that are the same for instance John has met this criteria but we also need to include Andrew in the count because he has the same User ID. So in this scenario the count would be 7 (Gary, Stephen, Brian, Simon, Darren, John, Andrew)
    4th query. I need to count the total amount of User ID’s where there is no data in the Last Logon Field and the UTC=”No”. This count needs to be similar to the 2nd query in that if there is a User ID that meets this requirement and another person with the same User ID does not meet the requirement then we need to disregard these users. So in this query the answer would be 2.
    5th query. I need to count the how many Unique User ID’s there are that meet the following criteria – UTC=”No” –Model =”AD” Type=”SIM”. In this case the answer is 2 (Rich & John)
    6th query. I need to count the total of User ID’s that meet the following criteria – UTC=”No” Model=”REL” Type=”COL”. In this case the answer is 5 (Stephen, Steve, Brian,Simon,Darren)
    7th query. I need to count the total of User ID’s that meet this criteria – UTC=”No” Model=”REL” Type=”COL” and also where there is data in the Last Logon field. So in this scenario the count would be 3 (Stephen, Simon , Darren)

    Thanks in advance.

  2. #2
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,276
    Post Thanks / Like
    Mentioned
    72 Post(s)
    Tagged
    14 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    @Marcelo Brancoand I answered your last request and we had doubts, because your rules were not clear.


    If you created another thread, you could at least notify and thank the commitment shown towards your solution.
    Regards Dante Amor

  3. #3
    MrExcel MVP
    Join Date
    Aug 2010
    Location
    Rio de Janeiro BRAZIL
    Posts
    16,269
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    8 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    Still confusing - as in the previous thread ...

    1st query
    Shouldn't the result be 4? Users 1, 5, 7 and 8

    M.

  4. #4
    Board Regular
    Join Date
    Feb 2018
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    Hi Dante,

    Apologies, will go and do that now.

    I appreciate all the help that was given.

    Thanks

  5. #5
    Board Regular
    Join Date
    Feb 2018
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    Hi Marcelo,

    As for Dante, thanks for support so far.

    Thanks for pointing out that the answer should be 4 and not 3. I looked at the wrong table when i worked out the answer.

    Thanks

  6. #6
    MrExcel MVP
    Join Date
    Aug 2010
    Location
    Rio de Janeiro BRAZIL
    Posts
    16,269
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    8 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    Let's do it by steps

    1st query
    Array formula
    =SUM(IF(FREQUENCY(IF(C2:C14<>"",IF(D2:D14="No",MATCH(A2:A14,A2:A14,0))),ROW(A2:A14)-ROW(A2)+1),1))
    confirmed with Ctrl+Shift+Enter, not just Enter

    Does it work for you?

    M.

  7. #7
    Board Regular
    Join Date
    Feb 2018
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    Thanks M. Works a treat.

  8. #8
    MrExcel MVP
    Join Date
    Aug 2010
    Location
    Rio de Janeiro BRAZIL
    Posts
    16,269
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    8 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    2nd query

    Array formula
    =SUM(IF(FREQUENCY(IF(ISNA(MATCH(A2:A14,IF((C2:C14<>"")+(D2:D14="Yes"),A2:A14),0)),MATCH(A2:A14,A2:A14,0)),ROW(A2:A14)-ROW(A2)+1),1))
    Ctrl+Shift+Enter

    Does it work for you?

    M.

  9. #9
    Board Regular
    Join Date
    Feb 2018
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    Thanks again M, works fine.

  10. #10
    MrExcel MVP
    Join Date
    Aug 2010
    Location
    Rio de Janeiro BRAZIL
    Posts
    16,269
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    8 Thread(s)

    Default Re: Formulas to count including Unique Numbers

    3rd query
    Shouldn't the result be 6? Gary, Stephen, Brian, Simon, Darren and John
    Brian has not logon date, but Gary and Stephen (same ID) have. Shouldn't Brian be counted too?

    M.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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