+ Reply to Thread
Results 1 to 13 of 13

Counting in a column (this is a tough one)

  1. #1
    Registered User
    Join Date
    06-01-2014
    Posts
    9

    Counting in a column (this is a tough one)

    So I have an annoying dataset to work with. The first column contains ID#, string, string, string, ID#, string, string, string, string, ID#, string, and so on. It is basically a list of patient numbers with a list of their appointments listed underneath them. I need to find a way to count up the number of strings for each patient, like shown below:

    Patient# Count
    101 2
    Had an appointment
    Had an appointment
    Deleted-Had an appointment
    202 1
    Had an appointment
    303 1
    Deleted - Had an appointment
    Had an appointment

    The format isn't too important. The data I have is basically column A, and I want to create column B. Any help would be greatly appreciated!

    EDIT: Sorry for cross-posting ( http://www.mrexcel.com/forum/excel-q...tough-one.html ) There is a different solution (not fully solved yet though) in that thread if you're interested.
    Last edited by klin0503; 06-03-2014 at 08:42 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Counting in a column (this is a tough one)

    If you end with number in A column (any number, 1234) then use this in B column:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    confirmed with ctrl+shift+enter (not just enter)

  3. #3
    Registered User
    Join Date
    06-01-2014
    Posts
    9

    Re: Counting in a column (this is a tough one)

    Ooops sorry I did something wrong. I will try it again
    Last edited by klin0503; 06-02-2014 at 02:59 PM.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Counting in a column (this is a tough one)

    Look at the example
    Attached Files Attached Files

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting in a column (this is a tough one)

    Hi,

    And are the strings either always 'Had an appointment' or 'Deleted - Had an appointment'. Or do the strings vary?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Counting in a column (this is a tough one)

    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  7. #7
    Registered User
    Join Date
    06-01-2014
    Posts
    9

    Re: Counting in a column (this is a tough one)

    They actually don't say either of those. They're varying strings, but i need to exclude the ones with "deleted" in it

  8. #8
    Registered User
    Join Date
    06-01-2014
    Posts
    9

    Re: Counting in a column (this is a tough one)

    Thanks, the problem now seems to be getting that last patient to work without having to add a number at the end.

  9. #9
    Registered User
    Join Date
    06-01-2014
    Posts
    9

    Re: Counting in a column (this is a tough one)

    Quote Originally Posted by zbor View Post
    If you end with number in A column (any number, 1234) then use this in B column:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    confirmed with ctrl+shift+enter (not just enter)
    Any way to make it match the next number OR the next blank? (which would solve the problem with the last patient I think)
    Last edited by klin0503; 06-02-2014 at 04:46 PM.

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Counting in a column (this is a tough one)

    Yes
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    comfirmed with ctrl+shift+enter

  11. #11
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting in a column (this is a tough one)

    @XOR - thanks for noting this

    @klin0503 - Please note

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

  12. #12
    Registered User
    Join Date
    06-01-2014
    Posts
    9

    Re: Counting in a column (this is a tough one)

    Quote Originally Posted by zbor View Post
    Yes
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    comfirmed with ctrl+shift+enter
    Thanks. This is working on the test file you sent me, but for some reason it's not working on my data set. Could you explain what the 1+ is doing?

    edit: It's working now (I made a little mistake in my formula), but I would still like to know what the 1+ is doing.
    Last edited by klin0503; 06-03-2014 at 10:23 AM.

  13. #13
    Registered User
    Join Date
    06-01-2014
    Posts
    9

    Re: Counting in a column (this is a tough one)

    Quote Originally Posted by Richard Buttrey View Post
    @XOR - thanks for noting this

    @klin0503 - Please note

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Sorry about this! Won't happen again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Help in counting D if column a is x and column b is y, count column c with a price of XXX
    By grlnexdor in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2013, 02:03 AM
  2. Counting Unique text in column B based on a criteria from column a
    By clocmasta in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2013, 06:40 PM
  3. Replies: 4
    Last Post: 04-25-2013, 03:53 AM
  4. [SOLVED] Counting Multiple Values in a column based on critera in seperate column
    By ERoberts in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2013, 01:08 PM
  5. Replies: 2
    Last Post: 09-10-2012, 10:05 AM

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