Count Unique Text Values

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
148
Office Version
  1. 2021
Platform
  1. Windows
I am trying to count unique text values and am using the following formula =SUM(IF(FREQUENCY(IF(AC1:AC16=1998,IF(AD1:AD16<>"",MATCH("~"&AD1:AD16,AD1:AD16&"",0))),ROW(AD1:AD16)-ROW(AD1)+1),1)) entered using cntrl, shft, enter.

My date cells are AC1:AC16 and the formula works fine with only the year in these cells, but these cells contain the year in the format 01/01/2018, is there a way of achieving this. Also is it possible for the year to be a range ie 1998 & 1999.

Thanks
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
To just get the year from column AC try:
=SUM(IF(FREQUENCY(IF(YEAR(AC1:AC16)=1998,IF(AD1:AD16<>"",MATCH("~"&AD1:AD16,AD1:AD16&"",0))),ROW(AD1:AD16)-ROW(AD1)+1),1))

For a range try:
Code:
[TABLE="width: 1103"]
<colgroup><col width="1103"></colgroup><tbody>[TR]
   [TD="width: 1103"]=SUM(IF(FREQUENCY([COLOR=#ff0000]IF(YEAR(AC1:AC16)>=1998,IF(YEAR(AC1:AC16)<=1999[/COLOR],IF(AD1:AD16<>"",MATCH("~"&AD1:AD16,AD1:AD16&"",0)))),ROW(AD1:AD16)-ROW(AD1)+1),1))
[/TD]
 [/TR]
</tbody>[/TABLE]

Enter with CTRL-SHIFT-ENTER
 
Upvote 0
Hi

Both formulas work great, thanks very much.
 
Upvote 0

Forum statistics

Threads
1,215,564
Messages
6,125,575
Members
449,237
Latest member
Chase S

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top