+ Reply to Thread
Results 1 to 3 of 3

Count of Account Numbers

  1. #1
    Registered User
    Join Date
    10-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Count of Account Numbers

    Hi all,

    I am trying to find the length of stay for patients moving within a hospital. See attached spreadsheet - For example, patient X123 makes a move to 2 units within the hospital. How do I calculate what their length of stay is for the combined moves? (It should be 8 minutes for this particular patient)

    Thanks!
    Attached Files Attached Files
    Last edited by doblerra; 10-21-2013 at 11:05 PM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Count of Account Numbers

    welcome to the forum, doblerra. what do you want to fill in under Column E? the accumulative time? only the total for the last time? for the former:
    =MAX(IF(A$2:A2=A2,C$2:C2))-MIN(IF(A$2:A2=A2,B$2:B2))

    for the latter:
    =IF(COUNTIF(A$2:A2,A2)<>COUNTIF($A$2:$A$7,A2),"",MAX(IF(A$2:A2=A2,C$2:C2))-MIN(IF(A$2:A2=A2,B$2:B2)))

    both formulas are array formulas
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    for simplicity, you can also just do this in E2:
    =C2-B2

    then do a Pivot Table
    Attached Files Attached Files

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    09-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Count of Account Numbers

    Easiest way is to consolidate your list of patients using a "remove duplicates," then do a sumif of the times - I've attached for your sample
    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)

Similar Threads

  1. [SOLVED] Remove an account range form a column with account numbers.
    By kokapelly in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-09-2013, 11:34 AM
  2. [SOLVED] How to censor account numbers based on how many characters are in the account number
    By Mcorydon in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-25-2013, 01:06 PM
  3. I need to count how many times an account name is used in a whole spreadsheet.
    By arsenalgtg in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-19-2012, 06:34 AM
  4. Replies: 9
    Last Post: 02-04-2011, 06:14 AM
  5. [SOLVED] Sorting Account Numbers
    By Erika in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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