+ Reply to Thread
Results 1 to 23 of 23

Count unique phrase

Hybrid View

darrenb Count unique phrase 09-23-2010, 07:14 AM
Marcol Re: Count unique phrase and... 09-23-2010, 07:21 AM
darrenb Re: Count unique phrase and... 09-23-2010, 07:24 AM
Marcol Re: Count unique phrase and... 09-23-2010, 07:33 AM
darrenb Re: Count unique phrase and... 09-23-2010, 07:40 AM
Marcol Re: Count unique phrase and... 09-23-2010, 07:54 AM
estige Re: Count unique phrase and... 09-23-2010, 08:08 AM
darrenb Re: Count unique phrase and... 09-23-2010, 08:23 AM
estige Re: Count unique phrase and... 09-23-2010, 08:29 AM
darrenb Re: Count unique phrase and... 09-23-2010, 09:02 AM
estige Re: Count unique phrase and... 09-23-2010, 09:21 AM
estige Re: Count unique phrase and... 09-23-2010, 09:36 AM
darrenb Re: Count unique phrase and... 09-23-2010, 09:55 AM
darrenb Re: Count unique phrase and... 09-24-2010, 03:51 AM
Marcol Re: Count unique phrase and... 09-24-2010, 07:18 AM
darrenb Re: Count unique phrase and... 09-24-2010, 07:20 AM
Marcol Re: Count unique phrase 09-24-2010, 03:19 PM
darrenb Re: Count unique phrase 09-25-2010, 06:43 AM
Marcol Re: Count unique phrase 09-25-2010, 06:58 AM
darrenb Re: Count unique phrase 09-25-2010, 07:03 AM
Marcol Re: Count unique phrase 09-25-2010, 07:53 AM
darrenb Re: Count unique phrase 09-25-2010, 09:21 AM
Marcol Re: Count unique phrase 09-25-2010, 10:26 PM
  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Count unique phrase

    Hello,

    I have attached an abstract of a spreadsheet which has a series of data and although I can work out various things, I'm stuck on the following:

    Typical phrase is:
    2010-08-01 10:24:00 +0000 1709120029: Device found: 00:23:d7:0f:26:25 (RSSI -90)

    1. The serial number 00:23:d7:0f:26:25 can repeat a few times, and want I'm looking to find out is the number of unique serial numbers within the document

    2. Im also looking to find the number of times the phrase "device found" is found in each hour of each day

    3. And lastly Im looking to know the number of times serial number with RETRY exists for each serial number, so I can say there were x number of 1 RETRY, y number of 2 RETRY, z numbers of RETRY etc etc

    Hopefully some of the Excel experts on here can help me solve this as its driving me mad!

    Cheers
    Last edited by darrenb; 09-23-2010 at 08:05 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Count unique phrase and other problems

    There appears to be a problem with your attachment, please check it out and post the corrected copy.

  3. #3
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase and other problems

    it works fine on mine? Its excel 2008?

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Count unique phrase and other problems

    Check by opening the attachment you have posted, it seems to be a workbook with no sheets.
    The sheet count is one, but nothing else can be accessed, except that the author is N******* M******.

  5. #5
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase and other problems

    hi, I have reattached in 2 formats, hope that helps??
    Attached Files Attached Files

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Count unique phrase and other problems

    Both files are okay.

    Please remove the attachment from post #1, it has somehow become compromised.

  7. #7
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Count unique phrase and other problems

    Hi, I had no problem opening the atachment from the first post.
    I have a possible solution using some helper columns and pivot tables.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase and other problems

    hi estige, thanks for your help, see the way you copied and pasted the serial numbers out, will your solution work by leaving them in?

    Basically this is a way to produce stats from an online system ie. we copy and paste in all the information and it automatically produces the results. We need it to be very quick?

  9. #9
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Count unique phrase and other problems

    Hi, I did't copy and paste at all. Serialnumbers are being extracted automatically if they have the format ??:??:??:??:??:??

  10. #10
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase and other problems

    hi, this looks great, there could be 800,000 entries in the spreadsheet though, can the pivot tables be extended for this?

  11. #11
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Count unique phrase and other problems

    Sure, but I have adjusted it a bit (see attachment).
    I have removed column A from the data source for the tables to avoid possible complications when you updata data. I have also extended the formulaes (in column B through F) down to row 9999. If you want more, just copy formulaes as far down as you need.
    Attached Files Attached Files

  12. #12
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Count unique phrase and other problems

    Quote Originally Posted by darrenb View Post
    there could be 800,000 entries in the spreadsheet though, can the pivot tables be extended for this?
    I asume you don't mean 800,000 unique serial numbers - that surely would call for another approach than listing them in a table. Because of that at least the method for counting retries would have to be different.

  13. #13
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase and other problems

    there would be 800,000 entries, but could be 40,000 unique serials? I could send the whole spreadsheet, but wouldnt want to put on forum for everyone to see?

    I really appreciate your help in this

  14. #14
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase and other problems

    can anyone help me with this???

  15. #15
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Count unique phrase and other problems

    Is your data imported on a daily basis?
    i.e. can the data be for more than one date?

  16. #16
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase and other problems

    its imported on a monthly period to run statisticaly information to give to the client.

    The suggestion above did work, but not for 800,000 entries?

  17. #17
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Count unique phrase

    Almost there with a somewhat slow, at the moment, VBa routine. Look back later tonight.

  18. #18
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase

    hi Marcol

    Did you work out a way? I see you posted something about a vba routine?

    Thanks for any help you can give

  19. #19
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Count unique phrase

    Should be there soon.

    Have you tried the solution offered here?
    http://www.ozgrid.com/forum/showthre...d=1#post523641

    It is very good but I don't think it is quite there, the hour results are incomplete.

    My code is much slower but it returns much more information, for each hour and day.

    Please let me know if you are going Robs' way.

    How are Retries defined, are they always ... RETRY/3
    or is it this way RETRY/1, RETRY/2, RETRY/3, etc. this can affect the execution time considerably.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  20. #20
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase

    hi, I dont know what to do with Robs code, I dont know how to insert it?

    No, they are always RETRY/3, but want I want to count is the number of times, this happens for each serial, so I want to then produce a pie chart showing

    1 retry- number of serials it happened for?
    2 retries- number of serials it happened for?
    3 retries- number of serials it happened for?

    I can send you the full spreadsheet with nearly 600,000 entries if that would be easier

  21. #21
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Count unique phrase

    Okay that makes life easier and the code faster.

    I'll revisit my code and post back in a few hours, got to go for a while.

    I'll test it against Robs' code and let you know the way to go. (Probably Robs' way with some mods)

    Don't need another workbook now I'll just use the data I have.

  22. #22
    Registered User
    Join Date
    09-23-2010
    Location
    northern ireland
    MS-Off Ver
    Excel 2008
    Posts
    11

    Re: Count unique phrase

    Thanks, got a few other queries

    1. the no. of devices needs to be per hour per day, so I can then collate a graph showing the no. of devices found over each day

    2. we are as previously mentioned, we need to find the number of times, RETRY exists for each unique serial number, can the code also be written to include the number of times FAIL exists for each unique serial and paste into a different column?

    3. this one might be tricky, is there a way to analyse all data and list the following of the numbers of times in the following range below

    extract example from data is (RSSI -90, 31535339s), (RSSI -89, 28s) etc etc


    less than 60s
    more than 61 but less than 120
    more than 121 but less than 300
    more than 301 but less than 600
    more than 601 but less than 1200
    more than 1201 but less than 1800
    more than 1801 but less than 2700
    more than 2701 but less than 3600
    more than 3601 but less than 5400
    more than 5401 but less than 7200
    more than 7201 but less than 14400
    more than 14401 but less than 28800
    more than 28801

  23. #23
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Count unique phrase

    Try this workbook to get the ball rolling

    1/. Import your data into sheet "2nd" as you normally do. If there is not a header row, then insert a row and give it a header name in A1, say "Text"

    2/. Run the macro "RemoveBankRows". This should clear and repopulate sheet "Data".
    This step is not required for any real purpose other than a testing backup, and will be integrated into the final code.

    3/. Run the macro "Main", this is still a bit slow but it can be improved, once we have an acceptable prototype.

    This should handle your original brief, and it has some built in provision for your later requests.

    Once you have reviewed this sample.
    1/. Do you want "FAILED/4" to be entered in a similar fashion to "RETRY/3"?

    2/. I'm not clear about your needs regarding "Device Blocked", do you need something similar to the layout I have for "Device Found"?

    3/. Your sample data doesn't cover a wide enough data range to make it clear what you mean in your last post, point 3.
    Can you put together a sheet that would clarify this. i.e. maybe a layout as you envisage the results.

    I hope this is on the lines you are after.

    Cheers.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1