Forum Discussion

MeganTPT's avatar
MeganTPT
Copper Contributor
Mar 03, 2024
Solved

Calculated value for difference between two dates, with IF qualifier

Hi all,

 

First time user of the forum and not a Lists expert, so please forgive any errors. See screenshot for example. I have a column in a list that calculates the value between two dates to give the number of days a task was open. However, users only input the second date when they close the task, and tasks are often open for many days/weeks. As a result, the simple formula I have used -

[Task Closed]-[Date Received ] - is giving a minus amount for days open which makes reporting difficult. 

I have a solution in mind but cannot find the suitable formula. Does anyone know of one, or have any other suggestions? Solution idea is:

- Include an 'IF' qualifier so that the column only populates if 'Task Closed' has been completed.

Thanks, Meg

  • MeganTPT You could use a formula like

    =IF(ISBLANK(End),"",(DATEDIF(Start,End,"D")))

     

    which results in:

     

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

3 Replies

  • Rob_Elliott's avatar
    Rob_Elliott
    Silver Contributor

    MeganTPT You could use a formula like

    =IF(ISBLANK(End),"",(DATEDIF(Start,End,"D")))

     

    which results in:

     

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)

    • MeganTPT's avatar
      MeganTPT
      Copper Contributor
      Thanks Rob- that solved it. Really appreciate your help.

Resources