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

1. ## 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

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

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

3. ## 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. ## 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. ## 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

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. ## Re: count unique number of years where the amount is greater than 1

amazing, thank you

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

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.

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

#### 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