+ Reply to Thread
Results 1 to 21 of 21

Counting # of specific values in one column for each unique IP in another column

  1. #1
    Registered User
    Join Date
    06-03-2013
    Location
    Bahamas
    MS-Off Ver
    Excel 2003
    Posts
    7

    Counting # of specific values in one column for each unique IP in another column

    Good day,

    I am new to this forum and I am not that good with excel. However, I know that it is powerful and i'm pretty sure that with the help of the creative genius on this forum, I should be able to obtain the formulas that i need. Here is my setup:

    Column A can have one of 4 keywords including (critcal, high, medium, and low)
    Column B has an IP address with matching octets for the first 3 octets e.g. 192.168.1.* in a range from 192.168.1.1 - .254

    I am trying to count each occurence of the 4 keywords for each unique ip so that i can build this type of report

    e.g.
    # of IP's with "critical" = 10
    # of IP's with "high" = 40
    # of IP's with "medium" = 30
    # of IP's with "low" = 50

    What is the simplest way for me to do this. I appreciate any help. Thanks in advance.
    Last edited by Light C; 06-03-2013 at 10:54 AM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    You get better help, with an excel example without confidentional information.

    Please also add the desired (expected) result.

    I guess it can be done with an helpcolumn (and after that an pivot table).

    If you show us the file, I will take a look at it.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    06-03-2013
    Location
    Bahamas
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting # of specific values in one column for each unique IP in another column

    Thanks, I appreciate your time and effort. Here is a sample of the spreadsheet:

    Coumn A Column B
    High 192.168.212.105
    High 192.168.212.105
    Low 192.168.212.105
    Critical 192.168.212.106
    Medium 192.168.212.106
    low 192.168.212.106
    High 192.168.212.107
    High 192.168.212.107
    High 192.168.212.107
    High 192.168.212.108
    low 192.168.212.108
    low 192.168.212.108
    low 192.168.212.108

    Based on the data above, I want the total number of Critical, High, Medium, and low. So for the above data:
    three IPs have "High
    three IP's have "low"
    one IP has a "medium"
    one IP has a "critical"

    Make sense? if not, I can attach an actual spreadsheet, if you tell me how...

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    Please add the file, so i can work in it.

  5. #5
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Counting # of specific values in one column for each unique IP in another column

    So long as the first three octets are always the same length (11 characters long in this case) you can do this...

    Add a column C and put the formula =LEFT(B2,11) and copy it down.

    Now for the counts you want use this array formula**
    =SUM(IF(FREQUENCY(IF(A2:A300="critical",IF(C2:C300<>"",MATCH(C2:C300,C2:C300,0))),ROW(C2:C300)-ROW(C2)+1),1))
    For the part of the above formula in red, change the word for each status.

    **When entering an array formula you must use Ctrl+Shift+Enter otherwise it won't work.
    Don't just use the answers provided for you. Try to understand how it works by reverse engineering or asking about it.

    Please mark the thread as [SOLVED] (Thread Tools->Mark thread as Solved) when answered.
    If you're happy with an answer given, please click the * under the person's name to boost their reputation.

  6. #6
    Registered User
    Join Date
    06-03-2013
    Location
    Bahamas
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting # of specific values in one column for each unique IP in another column

    I attached the file for viewing...
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    With helpcolumn and an pivot table.

    See the attached file.

    I delete a lot off data, otherwise the file is the big to post.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-03-2013
    Location
    Bahamas
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting # of specific values in one column for each unique IP in another column

    Thanks Oeldere, that looks like what i need, how can i copy and reproduce your report?

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    The formula in the sheet you can copy to your Original file.

    You realy use excel 2003 (and not 2007 or further)?

    It make the use of pivot table a lot easier (to use / to explain)

  10. #10
    Registered User
    Join Date
    06-03-2013
    Location
    Bahamas
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting # of specific values in one column for each unique IP in another column

    Hey Craig,

    The forumla only kept giving me "1".
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Counting # of specific values in one column for each unique IP in another column

    @ Light C - The formula has to be adjusted per what you're looking at. Take a look at the attached spreadsheet.
    Light C solution.xlsx
    FYI, the attached spreadsheet contains an extra record I put in. be sure to apply the solution to a fresh dataset


    @oeldere - sorry to call you out on this, but the solution you gave does not give an accurate count based on Host IDs provided

  12. #12
    Registered User
    Join Date
    06-03-2013
    Location
    Bahamas
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting # of specific values in one column for each unique IP in another column

    Hey Craig,

    Perfect, I did not need the plugin ID's calculated but that is fine. Whats the easiest way for me to duplicate this, copy and paste new values into the first 3 columns and adjust the ranges as necessary i'm guessing...

  13. #13
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Counting # of specific values in one column for each unique IP in another column

    If you keep the sheet I gave you as your form, then yes. When you update the formulas with new ranges, you MUST use Ctrl+Shift+Enter. Otherwise they won't work. You have to do this because they are array formulas.

  14. #14
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    @Craig K.

    Please Login or Register  to view this content.
    Please will you tell me, where you think it goes wrong.

    Then I will take a look at it.

  15. #15
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Counting # of specific values in one column for each unique IP in another column

    @Oeldere - Based on what Light C was asking for, the pivot you created did not count for unique instances of IP Address values. In order to do that with your pivot table you would need to put inside the Row Labels: (1)Risk, (2)helpcolumn. Then you would need to count the number of values inside each grouping. I hope that makes sense.

  16. #16
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    @Craig K.

    Thanks for the reply.

    Probably I understand what your trying to say.

    In column E you see (indeed) the unique numbers going from 1 to 2 etc.

    But in my pivot table I only selected the 1 values, so the result should be okay.

    Hope this will help to understand the solution.

  17. #17
    Valued Forum Contributor
    Join Date
    10-10-2012
    Location
    New York
    MS-Off Ver
    Excel 2007/2010
    Posts
    337

    Re: Counting # of specific values in one column for each unique IP in another column

    @oeldere - Your solution is correct. I got it in my head that something looked off and I was trying to ratinalize it. I apologise.

  18. #18
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    You don't have to apologise.

    I glad I cleared the air blue for you.

  19. #19
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    @Craig K.

    In that case you like the solution in the attached file more.
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    06-03-2013
    Location
    Bahamas
    MS-Off Ver
    Excel 2003
    Posts
    7

    Smile Re: Counting # of specific values in one column for each unique IP in another column

    Thank you gentlemen, you both have been a great help and I am extremely greatful for your expertise!

  21. #21
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting # of specific values in one column for each unique IP in another column

    Thanks for the reply.

    Glad I could help.

+ 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