Count unique text value based on another column, with long cell range

nostradamus

Board Regular
Joined
Aug 9, 2010
Messages
143
Office Version
  1. 365
Platform
  1. Windows
Hello dear all,

(I am using this table just for reference, so the Formula will be typed in Cell D2)
I have a complex question - I need a formula for:

1) Calculate Unique occurrences from Col.C that belong to "Texas" from Col.A. So, here the answer will be 8.
2) If I do not have any data entered in Columns A,B,C, Cell D2 should remain blank with nothing in it.
3) I need the formula to be able to cover range from Col.C2:Col.C1000. Caveat here is that sometimes data entered may be from 50 to 200 cells, and not the complete 1000 cell range in formula. So I want this formula to be able to cover the range of blank cells too if possible.

I am trying to make my requests as clear as possible, please ask if you need any more clarifications, or feel free to make suggestions to improve my solution.
Thanks!!!


Excel Workbook
ABCDEFGH
1StateCountyAreaPop.StateFreqCountyFreqAreaFreqexpectedAreaFreq
2TexasTravisBee Cave5511711
3TexasTravisCele2311
4TexasTravisLittig3311
5TexasTravisElroy841
6TexasTravisElroy15
7TexasTravisElroy23
8TexasTravisElroy34
9TexasGonzalesSmiley22211
10TexasGonzalesPilgrim3111
11TexasBellHolland14111
12TexasBexarSan Antonio5124111
13ColoradoDouglasLone Tree118611
14ColoradoDouglasCastle Pines1231
15ColoradoDouglasCastle Pines31
16ColoradoDouglasCastle Pines14
17ColoradoDouglasPinery2611
18ColoradoDouglasLarkspur5611
19ColoradoDenverGlendale25211
20ColoradoDenverBow Mar22411
21FloridaSarasotaSarasota Springs4569511
22FloridaSarasotaVenice60011
23FloridaSarasotaPlantation22111
24FloridaSarasotaNorth Port7511
25FloridaSarasotaMeadows2311
26FloridaPalm BeachWellington32441
27FloridaPalm BeachWellington45
28FloridaPalm BeachWellington46
29FloridaPalm BeachWellington12
Sheet1
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
What version of Excel are you using?
Please update your account details to show this, as it affects which functions you can use.
 
Upvote 0
It is Office 365
As requested by Fluff, please put this in your account details (click your user name at the top right of the forum. Don’t forget to scroll down & ‘Save’) so helpers always know.

You said the formula will go into D2 but column D already has data in it. Can you clarify?

Better still, can you post your sample data again (with XL2BB) but with the expected results manually entered in?
 
Upvote 0
Thanks for profile update suggestion. So here is the data table cleaned out

test.xlsx
ABCDEFG
1StateCountyAreaAvailabilityAvail.-Area Unique Count
2TexasTravisBee CaveYes8
3TexasTravisCeleNo
4TexasTravisLittigNo
5TexasTravisElroyYesTexas-Area Unique Count
6TexasTravisElroyYes7
7TexasTravisElroyYes
8TexasTravisElroyYes
9TexasGonzalesSmileyNo
10TexasGonzalesSmileyNo
11TexasBellHollandNo
12TexasBexarSan AntonioNo
13ColoradoDouglasLone TreeNo
14ColoradoDouglasCastle PinesYes
15ColoradoDouglasCastle PinesYes
16ColoradoDouglasCastle PinesYes
17ColoradoDouglasPineryNo
18ColoradoDouglasLarkspurYes
19ColoradoDenverGlendaleYes
20ColoradoDenverBow MarNo
21FloridaSarasotaSarasota SpringsNo
22FloridaSarasotaVeniceYes
23FloridaSarasotaPlantationNo
24FloridaSarasotaNorth PortYes
25FloridaSarasotaMeadowsYes
26FloridaPalm BeachWellingtonNo
27FloridaPalm BeachWellingtonNo
28FloridaPalm BeachWellingtonNo
29FloridaPalm BeachWellingtonNo
30
Sheet4

Need Two Formulas for:

1) Col F6 has unique counts of Area (from Col C) that occur in "Texas" (from Col A) - (expected answer in F6)

2) Col F2 has counts of "Yes" (from Col D) connected to unique occurrence in Area (Col C) - so this is a multiple criteria formula - (expected answer in F2)
 
Upvote 0
Thanks for that, how about
+Fluff v2.xlsm
ABCDEF
1StateCountyAreaAvailabilityAvail.-Area Unique Count
2TexasTravisBee CaveYes8
3TexasTravisCeleNo
4TexasTravisLittigNo
5TexasTravisElroyYesTexas
6TexasTravisElroyYes7
7TexasTravisElroyYes
8TexasTravisElroyYes
9TexasGonzalesSmileyNo
10TexasGonzalesSmileyNo
11TexasBellHollandNo
12TexasBexarSan AntonioNo
13ColoradoDouglasLone TreeNo
14ColoradoDouglasCastle PinesYes
15ColoradoDouglasCastle PinesYes
16ColoradoDouglasCastle PinesYes
17ColoradoDouglasPineryNo
18ColoradoDouglasLarkspurYes
19ColoradoDenverGlendaleYes
20ColoradoDenverBow MarNo
21FloridaSarasotaSarasota SpringsNo
22FloridaSarasotaVeniceYes
23FloridaSarasotaPlantationNo
24FloridaSarasotaNorth PortYes
25FloridaSarasotaMeadowsYes
26FloridaPalm BeachWellingtonNo
27FloridaPalm BeachWellingtonNo
28FloridaPalm BeachWellingtonNo
29FloridaPalm BeachWellingtonNo
30
Work
Cell Formulas
RangeFormula
F2F2=ROWS(UNIQUE(FILTER(C2:C29,D2:D29="Yes")))
F6F6=ROWS(UNIQUE(FILTER(C2:C29,A2:A29=F5)))
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,796
Members
449,095
Latest member
m_smith_solihull

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