Count Unique Values in a Cell - and the Entire Range that Cell Resides In

Philometis

New Member
Joined
May 19, 2014
Messages
32
I have a worksheet that has a column of cells but each cell has one to several field names. I find lots of guidance on counting unique values in a range of cells BUT not within cell and ranges.

The values in the cells are alphanumeric field names such as COLCOD, A15OB, ACCTNO etc.

The goal if not clear (the worksheet that this column is in has roughly 400 rows) is to count the unique instances of fields in the entire column BUT considering one cell in that column may have several fields as noted above. More specifically one cell might have:

COLCOD
A15OB
ACCTNO

In the above instance I need to return a unique count of 3. But as noted, those same fields could and will be referenced in other cells in the same column, and if those were the only fields, then the unique count of the column of cells would also be 3.

Currently, the fields are not separated by commas and though they happen to lie vertically in the column, that is simply due to the column width, so I may I need to use commas to help delineate a change in fields.

Greatly appreciate the help lads. I have found there to be plenty of brilliant people on this board and I know I can't be the first to have uncovered this need.

Finally, I would prefer the solution be contained within Excel functions since if I introduce VBA I believe it will impair my ability to share the sheet and results with several people that the worksheet gets shared with.

Thanks!

Philo

 
XOR,

Sorry for the late response. You are exactly correct - alt+enter is what "stacks" the values in each cell. I'm interested in hearing your solution. The others work via macros so it solves the problem, but in the vein of learning more, I would like to hear if you have a different solution...

Thanks!

Philo
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
No worries.

Perhaps you can have a go at adapting the solution I give here:

List of unique entries from column of space-separated strings | EXCELXOR

That's precisely the same as in your situation though with spaces as delimiter, not linebreaks.

Of course you're not actually interested in producing a list, simply a count. But if you read the first few paragraphs or so, you'll realise that the count forms part of that solution, and is given as a separate formula.

It's the array formula in C1 bit you'd want. And you'd need to make all the additions to Name Manager, as I describe. You don't need to bother with the rest of the article (though it's quite interesting, if I say so myself!).

All you'd need to do is to replace all occurrences of " " in all of those formulas with CHAR(10).

Perhaps if you have a go and then get back to me if you're struggling?

Cheers
 
Upvote 0
Upvote 0
Aladin,

Thanks for the clarification - am I correct in saying it is a "user defined function?"

Thanks again, and say hey to Robert van der Laan - a partner of mine from NL.

Philo
 
Upvote 0
XOR,

Will definitely test this out. Some great and intelligent chaps on this board / site. Thanks and I'll get back to you.

Philo
 
Upvote 0
Aladin,

Thanks for the clarification - am I correct in saying it is a "user defined function?"

The three functions, v(), eval(), and aconcat(), are user-defined functions. But, not the formula, if I may say so.

Thanks again, and say hey to Robert van der Laan - a partner of mine from NL.

Philo

I'm afraid I don't know him...
 
Upvote 0
Aladin,

This doesn't work in my actual workbook. I will be testing the population of cells, but at this stage, there are many empty cells in the entire range - would that prohibit this from working and if so, is there a method to account for it and fix it?

Thanks again!

Philo
 
Upvote 0
Aladin,

More specifically, the little caution box comes up next to the cell where the formula is placed and says "this formula contains unrevognized text." Hope that helps and thanks again!
 
Upvote 0

Forum statistics

Threads
1,215,615
Messages
6,125,854
Members
449,266
Latest member
davinroach

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