Count unique entries

reaktorblue

Board Regular
Joined
Aug 8, 2007
Messages
87
Office Version
  1. 365
Platform
  1. Windows
Hiyas,

I have a spreadsheet where I'm trying to calculate the amount of unique entries in such that it would mean the amount of transactions.

Since each line has a cell which contains the date, many lines with the same date (down to the second) would indicate 1 transaction. This means the following is one transaction.

11/08/11 - 4:15:44 AM
11/08/11 - 4:15:44 AM
11/08/11 - 4:15:44 AM

As an FYI, these dates are in a UK format and may look confusing without mentioning this. What I need to accomplish is tallying up the number of transactions, so in this example, if I were to have something along the lines of the following:

11/08/11 - 4:15:44 AM
11/08/11 - 4:15:44 AM
11/08/11 - 4:15:44 AM
12/08/11 - 3:10:18 PM
14/08/11 - 6:15:17 PM
14/08/11 - 7:00:00 PM
14/08/11 - 7:00:00 PM

This would be 4 unique values and as such, 4 separate transactions. After much research I thought I would be able to accomplish this using the =FREQUENCY function but I cannot seem to figure this out.

Could anyone give me a hand and perhaps shed some light on my problem? Thank you very much for all of the help everyone has given me over the years. I greatly appreciate it!!



Warmest Regards,

RB
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Maybe this:

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;">11/8/11 04:15:44</td><td style="text-align: right;;"></td><td style="text-align: center;;">Total</td><td style="text-align: center;;">4</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">11/8/11 04:15:44</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">11/8/11 04:15:44</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">12/8/11 15:10:18</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">14/8/11 18:15:17</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: right;;">14/8/11 19:00:00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: right;;">14/8/11 19:00:00</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">*****</td><td style=";">*****</td><td style=";">*****</td><td style=";">*****</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet8</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">D1</th><td style="text-align:left">=SUMPRODUCT(<font color="Blue">--(<font color="Red">FREQUENCY(<font color="Green">A1:A7,A1:A7</font>)>0</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
Markmzz
 
Upvote 0
I tried that formula, where my data is entered in the range of C13:C40 however the result I seem to get is 0. Just to recap, I tried =SUMPRODUCT(--(FREQUENCY(C13:C40,C13:C40)>0)) but the only result I was able to get was 0.

By the way, I really like the format you're using to illustrate the table structure and formula. It's made it much easier to understand, although I'm still having trouble with it.
 
Upvote 0
Try this (for TXT):

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">11/08/11 - 4:15:44 AM</td><td style="text-align: right;;"></td><td style="text-align: center;;">Total</td><td style="text-align: center;;">4</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">11/08/11 - 4:15:44 AM</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">11/08/11 - 4:15:44 AM</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">12/08/11 - 3:10:18 PM</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">14/08/11 - 6:15:17 PM</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">14/08/11 - 7:00:00 PM</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style=";">14/08/11 - 7:00:00 PM</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">*****</td><td style=";">*****</td><td style=";">*****</td><td style=";">*****</td></tr></tbody></table><p style="width:4.2em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet9T</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">D1</th><td style="text-align:left">=SUMPRODUCT(<font color="Blue">--(<font color="Red">FREQUENCY(<font color="Green">MATCH(<font color="Purple">A1:A7,A1:A7,0</font>),MATCH(<font color="Purple">A1:A7,A1:A7,0</font>)</font>)>0</font>)</font>)</td></tr></tbody></table></td></tr></table><br />

Use the links below for helper to post your examples.

Instructions:
http://www.mrexcel.com/forum/showpost.php?p=2545970&postcount=2

File HtmlMaker20101230.zip:
https://skydrive.live.com/?cid=8cffdec0ce27e813&sc=documents&id=8CFFDEC0CE27E813!189

Markmzz
 
Upvote 0
Hiyas,

I have a spreadsheet where I'm trying to calculate the amount of unique entries in such that it would mean the amount of transactions.

Since each line has a cell which contains the date, many lines with the same date (down to the second) would indicate 1 transaction. This means the following is one transaction.

11/08/11 - 4:15:44 AM
11/08/11 - 4:15:44 AM
11/08/11 - 4:15:44 AM

As an FYI, these dates are in a UK format and may look confusing without mentioning this. What I need to accomplish is tallying up the number of transactions, so in this example, if I were to have something along the lines of the following:

11/08/11 - 4:15:44 AM
11/08/11 - 4:15:44 AM
11/08/11 - 4:15:44 AM
12/08/11 - 3:10:18 PM
14/08/11 - 6:15:17 PM
14/08/11 - 7:00:00 PM
14/08/11 - 7:00:00 PM

This would be 4 unique values and as such, 4 separate transactions. After much research I thought I would be able to accomplish this using the =FREQUENCY function but I cannot seem to figure this out.

Could anyone give me a hand and perhaps shed some light on my problem? Thank you very much for all of the help everyone has given me over the years. I greatly appreciate it!!



Warmest Regards,

RB
Control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(A2:A8<>"",MATCH("~"&A2:A8,A2:A8&"",0)),ROW(A2:A8)-ROW(A2)+1),1))

where A2:A8 houses the sample you provided. If no chars like < can occur around the entries, you can omit the "~"& and &"" bits from the formula.
 
Upvote 0
try this
Excel Workbook
AB
211/08/11 - 4:15:44 AM4
311/08/11 - 4:15:44 AM
411/08/11 - 4:15:44 AM
512/08/11 - 3:10:18 PM
614/08/11 - 6:15:17 PM
714/08/11 - 7:00:00 PM
814/08/11 - 7:00:00 PM
Sheet2
Excel 2007
Cell Formulas
RangeFormula
B2=SUMPRODUCT(1/COUNTIF(A2:A8,A2:A8))
 
Upvote 0
Just for info (my version is not so good), you can replace SUMPRODUCT in markmzz's formula with following:
=COUNT(IF(FREQUENCY(MATCH(A1:A7,A1:A7,0),MATCH(A1:A7,A1:A7,0))>0,FREQUENCY(MATCH(A1:A7,A1:A7,0),MATCH(A1:A7,A1:A7,0))))
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

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