+ Reply to Thread
Results 1 to 7 of 7

count unique number of years where the amount is greater than 1

  1. #1
    Registered User
    Join Date
    04-08-2024
    Location
    London, England
    MS-Off Ver
    365
    Posts
    7

    count unique number of years where the amount is greater than 1

    Hi all

    Could anyone help me with a formula to be able to count the unique number of years in column B but only where the amount is column C is greater than 1 on the attached example please?

    I thought perhaps a countif would be the way to go, but I couldn't get it to work. This is a bit above my skill level.

    any help would be greatly appreciated.

    thank you
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    84,036

    Re: count unique number of years where the amount is greater than 1

    Are your expected results correct?

    =LET(u,SORT(UNIQUE(B2:B8)),HSTACK(u,COUNTIFS(B2:B8,u,C2:C8,">"&0)))
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    84,036

    Re: count unique number of years where the amount is greater than 1

    Sorry - misread the requirement (because of the file name!) - should be this:

    =LET(u,SORT(UNIQUE(B2:B8)),HSTACK(u,COUNTIFS(B2:B8,u,C2:C8,">"&1)))

  4. #4
    Registered User
    Join Date
    04-08-2024
    Location
    London, England
    MS-Off Ver
    365
    Posts
    7

    Re: count unique number of years where the amount is greater than 1

    thank you Ali, oh dear you are right i couldn't even get my own example right! I blame a very intense 3 weeks at work and my brain in completely frazzled! this has worked thank you and I am so glad you could help because i have never would have been able to come up with this!
    may i ask, what does the small u represent/ mean like this? I have never seen before.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    84,036

    Re: count unique number of years where the amount is greater than 1

    LET allows you to set parameters - I used u as the name for the unique list of years. I then reused that unique list in the COUNTIFS. You can choose whataver name you choose as long as it's not an existing function name or cell reference.

    https://bettersolutions.com/excel/fu...t-function.htm

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  6. #6
    Registered User
    Join Date
    04-08-2024
    Location
    London, England
    MS-Off Ver
    365
    Posts
    7

    Re: count unique number of years where the amount is greater than 1

    amazing, thank you

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    84,036

    Re: count unique number of years where the amount is greater than 1

    Glad to have helped.

    If you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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. Replies: 3
    Last Post: 07-27-2021, 10:41 AM
  2. Replies: 1
    Last Post: 11-11-2020, 03:44 PM
  3. [SOLVED] Unique count based on year excluding duplicate values from previous years
    By Estevaoba in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-07-2020, 08:39 PM
  4. [SOLVED] Count No. of unique values greater than 100
    By Lucille Boshoff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-08-2016, 07:25 AM
  5. [SOLVED] Retention formula to count unique customers that made a purchase in both years
    By stu40 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-23-2016, 01:24 AM
  6. [SOLVED] Count amount of unique values with multiple conditions
    By Melon6 in forum Excel General
    Replies: 17
    Last Post: 05-19-2015, 11:59 AM
  7. Replies: 4
    Last Post: 10-24-2012, 10:54 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