+ Reply to Thread
Results 1 to 15 of 15

Counting Days

  1. #1
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Counting Days

    Hello,

    I am trying to find a formula that will count how long a person is in a certain status. The picture below shows the end result that I am looking for (in column E).

    Example1.JPG

    I want the formula find the last time a Name appears in the Name column and count how many days it has been in that status.

    Any help is appreciated!
    Attached Files Attached Files
    Last edited by KoolKatelyn; 12-05-2016 at 04:51 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Counting Days

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff) - and, depending on what browser is being used, some pics dont even show up on the forum

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Counting Days

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff) - and, depending on what browser is being used, some pics dont even show up on the forum

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Counting Days

    A simple B2-A2 should do what you want

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Counting Days

    Try

    in E2

    =IF(MAX(IF($D$2:$D$7=$D2,$A$2:$A$7,""))=$A2,$B2-$A2+1,"")

    Enter with Ctrl+Shift+Enter

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Counting Days

    If you tried to attach a file, it looks like it didnt come through, can you try again?

  7. #7
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: Counting Days

    Sorry, I was struggling to upload my Excel document at first, but I think it went through now. Are you able to open it?

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Counting Days

    Tyy

    =IF(MAX(IF($D$2:$D$7=$D2,$A$2:$A$7,""))=$A2,$B2-$A2,"")

    Add 1 if days are inclusive

    =IF(MAX(IF($D$2:$D$7=$D2,$A$2:$A$7,""))=$A2,$B2-$A2+1,"")

    Enter with Ctrl+Shift+Enter

  9. #9
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: Counting Days

    John - Thank you so much for your help! Your formula works perfectly!

    FDibbins - Thank you for suggesting to attach my Excel Document. I will start doing that from now on!
    Last edited by KoolKatelyn; 12-05-2016 at 05:01 PM.

  10. #10
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: Counting Days

    John - Sorry to bother you again. I tried adding onto my worksheet and the formula is not functioning properly now. Could you please explain to me why it may not be working? Is it something that I am not doing correctly?
    Attached Files Attached Files
    Last edited by KoolKatelyn; 12-05-2016 at 05:31 PM.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Counting Days

    I'll need to re-think this: maybe someone else will look at it in the meantime.

    Need to remove "SOLVED" from thread.

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Counting Days

    Try this modification of JohnTopley's formula. It is also array entered.

    =IF(MAX(IF($D$2:$D$8=$D2,$A$2:$A$8,""))=$A2,$B2-INDEX($A$2:$A$8,MATCH(1,1/(D2=$D$2:$D$8)*(C2=$C$2:$C$8),0)),"")

    Edit By the way ... as I now understand it row 6 (E6) is 5? That's what this formula returns. Am I missing something?
    Last edited by FlameRetired; 12-05-2016 at 07:01 PM.
    Dave

  13. #13
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: Counting Days

    Quote Originally Posted by FlameRetired View Post
    Try this modification of JohnTopley's formula. It is also array entered.

    =IF(MAX(IF($D$2:$D$8=$D2,$A$2:$A$8,""))=$A2,$B2-INDEX($A$2:$A$8,MATCH(1,1/(D2=$D$2:$D$8)*(C2=$C$2:$C$8),0)),"")

    Edit By the way ... as I now understand it row 6 (E6) is 5? That's what this formula returns. Am I missing something?
    You are correct, (E6) should be 5. The formula you provided works! Thank you so much for your help!

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Counting Days

    You are welcome. Thank you for the feedback and the rep ... though JohnTopley did the heavy work.

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,779

    Re: Counting Days

    @Dave, ...
    the heavy work.
    I don't think so ... it was very much your solution.

+ 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. Replies: 15
    Last Post: 06-17-2016, 01:59 AM
  2. [SOLVED] How to find Sum of # of days w/o counting overlapping days twice
    By lanksout in forum Excel General
    Replies: 18
    Last Post: 08-11-2015, 02:15 AM
  3. [SOLVED] Number of days till.. Formula for counting number of days
    By Saturn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-21-2013, 05:46 AM
  4. Counting of days
    By dscheeringa in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-04-2013, 02:48 PM
  5. Replies: 9
    Last Post: 09-03-2007, 08:26 PM
  6. counting days?
    By Richard in forum Excel General
    Replies: 2
    Last Post: 08-01-2006, 09:40 AM
  7. counting days
    By ceemo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-24-2005, 08:22 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