+ Reply to Thread
Results 1 to 3 of 3

How to count the number of days since the last "accident" with two variables?

  1. #1
    Registered User
    Join Date
    09-09-2022
    Location
    UK
    MS-Off Ver
    365
    Posts
    2

    Question How to count the number of days since the last "accident" with two variables?

    I have attached a sample file.

    I'm looking for a formula that counts the number of days it has been since the last 'accident' where the type of injury is not 'property damage'. The current formula I am using is =IF(Table1[Type of report]="Accident",DATEDIF(Table1[Date and time],TODAY(),"D"),"") but this includes all accidents including property damage which I need to exclude. Is there any way of achieving this?

    Any help is appreciated, thanks.

    TEST.xlsx

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,775

    Re: How to count the number of days since the last "accident" with two variables?

    EDIT
    re read an i think you want
    =IF(AND(Table1[@[Type of report]]="accident", Table1[@[Type of Injury]]<>"property damage"),TODAY()-Table1[@[Date and time]],"")




    try
    =IF(Table1[@[Type of Injury]]<>"property damage", TODAY()-Table1[@[Date and time]],"")
    Attached Files Attached Files
    Last edited by etaf; 09-09-2022 at 05:27 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    09-09-2022
    Location
    UK
    MS-Off Ver
    365
    Posts
    2

    Re: How to count the number of days since the last "accident" with two variables?

    EDIT
    That's exactly what I needed.

    I've been trying to do that for a couple of days now and you've solved it in minutes, thanks again!


    ----------------------------------------------------------------------------------------------------------------------------------------

    Thanks for the reply!

    I'll give it a try and get back to you.
    Last edited by 98Hodge; 09-09-2022 at 06:34 AM.

+ 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: 11
    Last Post: 06-05-2020, 02:08 AM
  2. Replies: 4
    Last Post: 06-02-2017, 02:17 AM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. [SOLVED] Count the number of cells over 35 days excluding rows/cells that have a "yes" value
    By northcoms in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2013, 10:25 AM
  5. count days when value change from "0 to +" and "0 to -" using formula
    By amruta_shah15 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2012, 01:17 PM
  6. count days when value change from "0 to +" and "0 to -" using formula
    By amruta_shah15 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2012, 01:13 PM
  7. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 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