Forum Discussion
Counting text only once within date range
Hi,
Thanks for coming back to me so quickly.
Looking back at my post, I didn't explain what I'm trying to get out of this, so sorry!
I'm trying to create a formula that will only count the 'Clinical Area' text only once, but will only include them where they fall within a certain date.
So, for example, I'd like the formula to look up how many clinical areas there were between 01/01/2024 - 31/12/2024. I've given you a slightly bigger sample below, as you mention the above wasn't big enough.
For clinical areas in 2024 the answer to the formula should be 2 using the data below. Although there are 4 clinical areas in total, only 2 of those were contracted in 2024 (although MS occurs twice, I only want it to be counted once).
I hope that makes more sense and you can still help me! :-)
Thank you.
=IF(SUM(--(YEAR(Tabelle1[Year Contracted])=2024))=0,"nothing",COUNTA(UNIQUE(FILTER(Tabelle1[Clinical Area],YEAR(Tabelle1[Year Contracted])=2024))))
Or you could do it with a pivot table (distinct count).
https://www.excelcampus.com/pivot-tables/distinctcount-pivot-tables/