+ Reply to Thread
Results 1 to 4 of 4

Number of days since last event occurred

  1. #1
    Registered User
    Join Date
    08-26-2013
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    10

    Number of days since last event occurred

    I've attached a sample file showing how my data looks.

    I need a formula that calculates the number of days since an event occurred within the same group.

    Example
    I have my groups in Column A (Units or ICU)
    Column B has the dates
    Column C has a 1 or Null (1 if an event happen)
    In Column D I need a formula that calculates the number of days since the group last had an event.

    btw: my actual file has over 200K rows so VBA is OKay if anyone has a better way.

    I hope my sample file makes since

    Thanks
    Attached Files Attached Files

  2. #2
    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: Number of days since last event occurred

    Hi,

    Does the attached help
    Attached Files Attached Files
    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.

  3. #3
    Registered User
    Join Date
    08-26-2013
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Number of days since last event occurred

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Does the attached help
    It works but can you help me understand the last IF function
    =IF(AND($A10="Units",$C10=1),B10,IF(F9=0,0,F9))

    How is it the cell above = 0
    When it has a date in it?

    Steve

  4. #4
    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: Number of days since last event occurred

    Hi,

    I think it was a hangover from a previous formula I was working with. You can change it to just
    =IF(AND($A10="Units",$C10=1),B10,F9)

+ 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. Conditional Formula for number of days an event listing is on a website
    By moffely in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2013, 06:10 AM
  2. Replies: 4
    Last Post: 11-07-2012, 04:02 PM
  3. Find Friday on which maximum number of widgits occurred.
    By Carrfamily in forum Excel General
    Replies: 5
    Last Post: 02-09-2012, 04:09 PM
  4. How to tell the order in which an event occurred?
    By Camanarac in forum Excel General
    Replies: 6
    Last Post: 04-01-2011, 01:00 PM
  5. Replies: 2
    Last Post: 05-06-2010, 12:20 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