VBA or Formula that gives me all unique values in a column AND counts how many times that value appears.

booleanboolean

New Member
Joined
Feb 25, 2017
Messages
37
Hello all,

I want to know if there is a VBA or Formula that will let me know how many unique values are in a certain column AND how many times that value appears in each column:

MONTUEWEDTHUFRISATSUN
5a-1p5a-1pOFFOFF5a-1p5a-1p5a-1p
OFF6a-2p6a-2p6a-2p6a-2p6a-2pOFF
OFFOFF6a-2p6a-2p6a-2p6a-2p6a-2p
8p-4a8p-4a8p-4aOFFOFF8p-4a8p-4a
6a-2p6a-2p6a-2p6a-2pOFFOFF6a-2p
6a-2p6a-2p6a-2p6a-2pOFFOFF6a-2p
12p-8p12p-8pOFFOFF12p-8p12p-8p12p-8p
6a-2pOFFOFF6a-2p6a-2p6a-2p6a-2p
2p-10pOFFOFF2p-10p2p-10p2p-10p2p-10p
2p-10p2p-10p2p-10p2p-10pOFFOFF2p-10p
OFFOFF2p-10p2p-10p2p-10p2p-10p2p-10p
OFF2p-10p1215p-815p12p-8p2p-10p2p-10pOFF
OFF10p-6a10p-6a10p-6a10p-6a10p-6aOFF
10p-6aOFFOFF10p-6a10p-6a10p-6a10p-6a
OFF2p-10p2p-10p2p-10p8p-4a8p-4aOFF
OFF9p-5a9p-5a9p-5a9p-5a9p-5aOFF
8p-4aOFFOFF8p-4a8p-4a8p-4a8p-4a
OFF8p-4a8p-4a8p-4a8p-4a8p-4aOFF
8p-4a8p-4a8p-4a8p-4aOFFOFF8p-4a
9p-5a9p-5a9p-5aOFFOFF9p-5a9p-5a
10p-6a10p-6a10p-6aOFFOFF10p-6a10p-6a
9p-5aOFFOFF9p-5a9p-5a9p-5a9p-5a

<colgroup><col span="7"></colgroup><tbody>
</tbody>


My project is to count how many times different shifts (5A-1P, 10P-6A, etc) occur EACH DAY. For example, 5A - 1P occurs occurs ONCE on Monday and ONCE on Tuesday, but 0 on Wednesday.

I have been doing this manually and it's such a pain on my eyes. I want to know if there is an easier way to do this via Macro or Formula.

THANKS!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Count unique values:

=SUM(IF(FREQUENCY(MATCH(A28:A32,A28:A32,0),MATCH(A28:A32,A28:A32,0))>0,1))

To count how many times that value appears in each column, first you need to tell if the values is restricted list or can have diferent and imprevisible values.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,537
Messages
6,114,216
Members
448,554
Latest member
Gleisner2

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